Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Customer Table
- id | room_id
- 1 | 2
- 2 | 2
- 3 | 1
- 4 | 0
- 5 | 2
- Rooms Table
- id | head
- 1 | 1
- 2 | 4
- 3 | 2
- 4 | 3
- Expected Result
- room_id | occupied | total_head | remaining_head
- 2 | 3 | 4 | 1
- 3 | 0 | 2 | 2
- 4 | 0 | 3 | 3
Advertisement
Add Comment
Please, Sign In to add comment