I have 2 tables which provides list of all rooms and booked rooms. Can I Subtract the Room_Count with Room_Used?
Select type,count(room_number)as Room_Count from room group by type
Type | Room Count
A1 | 10
A2 | 10
Select type,count(room_number)as Booked_Count from room_used group by type
Type | Booked_Count
A1 | 5
So I tried this Query
select a.type,count(a.room_count)-count(b.room_booked)as room_avail from room a,room_used b where a.room=b.room_used
Type | Room_avail
A1 | 5
It seems fine at start,but how to display the un-substracted ones,like this?
Type | Room_avail
A1 | 5
A2 | 10