1
Answer

how to calculate the booking seats using sql server

narasiman rao

narasiman rao

9y
705
1
 
    i have two query as follows

select top 1 Total_Seats from batch_seats where cbm_batch_id ='B5176 '
When i run the above query output as follows

Total_Seats
24

select top 1 Avil_seats from batch_seats where cbm_batch_id = 'B5176'
When i run the above query output as follows

Avil_seats
6

Using the above two query i want output as follows
Booked Seats
18 (Total_Seats 24 - Avil_seats 6)

for getting output 18 how can i write the query.

Please help me.
Regards,
Narasiman P. 
Answers (1)