Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT r.*, c.firstname, c.lastname, SUM(d.amount) AS amount FROM reservation r
- INNER JOIN customer c ON c.id = r.customer_id
- INNER JOIN reservation_details d ON d.reservation_id = r.id
- GROUP BY d.reservation_id
- ORDER BY r.id DESC
- SELECT r . * , c . * , SUM( d.amount ) AS amount FROM reservation r
- INNER JOIN customer c ON c.id = r.customer_id
- INNER JOIN reservation_details d ON d.reservation_id = r.id
- GROUP BY d.reservation_id
- ORDER BY r.id DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement