Skip to content
Advertisement

PostgreSQL missing FROM-CLAUSE entry

I have the following query:

It tells me: ERROR: missing FROM-clause entry for table "sb.bookings" LINE 2: SELECT "shiftId", "sb.bookings"."state", "visibleAt" FRO...

I wrote it as "sb.bookings"."state" because state is in both tables, but it didn’t want to allow me to write it as "bookings"."state" ( I don’t know why either )

Does anyone have any ideea about this?

Advertisement

Answer

Your CTE is prefacing the state column with an identifier which does not exist. And, you can simplify your final query:

The quoted version of your CTE:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement