Re: ERROR: missing FROM-clause entry for table

Поиск
Список
Период
Сортировка
От Charles Clavadetscher
Тема Re: ERROR: missing FROM-clause entry for table
Дата
Msg-id 036001d163d6$fdc96340$f95c29c0$@swisspug.org
обсуждение исходный текст
Ответ на ERROR: missing FROM-clause entry for table  (bigkev <kevin.waterson@gmail.com>)
Список pgsql-general
Hello

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of bigkev
> Sent: Mittwoch, 10. Februar 2016 08:11
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] ERROR: missing FROM-clause entry for table
>
> I am receiving this error for the query pasted below.
> Is the LEFT JOIN on the table not enough?
> What needs to happen here?
> I am guess something to do with derived tables
>
> http://pastie.org/10715876

It would help to know for which table the clause entry is missing. I guess that the order of the joins is not correct:

left join generate_series(c.start_time, c.end_time, '2 weeks'::interval) f(fortnight) ON g.day=f.fortnight
LEFT JOIN call_schedule c on extract(dow from c.start_time) = extract(dow from g.day)  AND f.fortnight IS NOT NULL AND
g.dayBETWEEN 
c.start_time AND c.end_time

In the first line you use c, but this is declared on the following line.

Bye
Charles

>
>
>
> --
> View this message in context: http://postgresql.nabble.com/ERROR-missing-FROM-clause-entry-for-table-tp5886750.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general



В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: ERROR: missing FROM-clause entry for table
Следующее
От: Roxanne Reid-Bennett
Дата:
Сообщение: Re: ERROR: missing FROM-clause entry for table