Home > OS >  POSTGRES simple sql error cannot figure it out joining another table
POSTGRES simple sql error cannot figure it out joining another table

Time:06-08

I have a relatively simple query or so I thought, table structures are workers and availabilities. availabilities have a many to one bi directional relationship with workers, so each worker has many availabilities, each availabilities has one worker.

I have a query a little bit more complex than this but I can't get a simple join to even work now, this is probably blantantly obvious to someone but my query is

SELECT * FROM workers as w
LEFT JOIN availabilities as a ON a.worker.id = workers.id
WHERE w.rate_per_hour <= 500.00

and the error is just SQL Error [42P01]: ERROR: missing FROM-clause entry for table "worker"

from is obviously there, I dont get it what am I missing.

CodePudding user response:

Perhaps you meant a.worker_id = w.id ?

  • Related