Book Table
bookID tripNo
b01 t01
b02 t02
b03 t03
Trip Table
tripNo bookID seat1 seat1 seat2 seat3 seat4 seat5 seat6 seat7 seat8 seat9 seat10 seat11 seat11
t01 b01 booked booked NULL NULL booked booked booked booked NULL NULL NULL booked booked
t02 b02 NULL booked NULL NULL booked NULL booked NULL NULL booked NULL booked booked
t03 b03 booked booked NULL booked booked booked booked booked NULL booked booked booked booked
how do i make it like show all the seat that is not NULL?
Expected Result
bookID Booked
b01 seat1,seat2,seat5,seat6,seat7,seat12,seat13
b02 seat2,seat5,seat7,seat10,seat12,seat13