I have this Table:
I am trying to count how many airlines tickets sold in a booking system I am developing.
Some fixed values are:
Booking leader is stored in booking table so after counting how many companion in a single booking we need to add 1, i.e. 1+sum(companion names) where packageID=1 and booking.status=Confirmed and companion_table.title<>'In
I tried to solve it and I got this query but Its not what I want
booking.packageid AS soldSeats,
Inner Join companion_table ON booking.companion_id = companion_table.companion_id
booking.packageid = '1'
The result I am expecting is to get 5 Sold
Which means 5 Airlines Tickets sold
And here is a print screen of the original booking:
Thank you in Advanced