I have the following SQL
SELECT CASE
WHEN B.bookingId = P.bookingId
THEN 1
ELSE 0
END AS PAID
FROM Booking B
LEFT OUTER JOIN Payment P ON P.bookingId = B.bookingId
This outputs 3 rows; 1, 1 and 0
I would like to extend this query to output the booking details of the 0 value.
How can I do this?
Thanks
1 Answer