narasiman rao

narasiman rao

  • 1.6k
  • 519
  • 673.7k

how to calculate the booking seats using sql server

Nov 27 2014 4:43 AM
 
    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)