SQL COUNT() statement not working -


i trying return total number of reserved seats in flightbooking table using flightid number.

select count(flight.flightid) reservedseats flightbooking status=r 

i error saying

error: missing from-clause entry table "flight" line 1: select count(flight.flightid) reservedseats flightbo...

what doing wrong?

try:

select count(flight.flightid) reservedseats    flightbooking flight  status='r' 

you referring flight.flightid there isn't table name or alias flight. engine doesn't know should retrieve flightid from. missing quotes around char value r.

in comment "i know nothing sql". appriciated if research before come here asking help.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -