ERROR: missing FROM-clause entry for table

From: Kevin Waterson <kevin(dot)waterson(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: ERROR: missing FROM-clause entry for table
Date: 2016-02-21 13:22:45
Message-ID: CAJSapQ1uokVvF_uNBqzLwWVqzuX5ADDsGD-vfotP-5K5qD9crQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I do not understand why I am getting this error.
I have joined the table correctly, is this not sufficient?

forge=> select * FROM generate_series('2016-01-22', '2017-12-31', '1
day'::interval) AS day
LEFT JOIN (
select *, generate_series(c.start_time,
c.end_time, '2 week'::interval) meeting
from call_schedule c
join call_durations cds on c.duration_id=cds.id
where call_frequency_id = 5
) c on ((day, '1 day'::interval) OVERLAPS (meeting,
cds.duration * '1s'::interval));
ERROR: missing FROM-clause entry for table "cds"
LINE 7: ...c on ((day, '1 day'::interval) OVERLAPS (meeting, cds.durati...

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vik Fearing 2016-02-21 13:38:56 Re: ERROR: missing FROM-clause entry for table
Previous Message Bill Moran 2016-02-21 12:56:09 Re: JDBC behaviour