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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -