Re: Adding missing FROM-clause entry in subquery

Поиск
Список
Период
Сортировка
От Robert Treat
Тема Re: Adding missing FROM-clause entry in subquery
Дата
Msg-id 1065112863.16666.1346.camel@camel
обсуждение исходный текст
Ответ на Adding missing FROM-clause entry in subquery  (<btober@seaworthysys.com>)
Ответы Re: Adding missing FROM-clause entry in subquery
Список pgsql-general
On Thu, 2003-10-02 at 08:58, btober@seaworthysys.com wrote:
>
> INSERT INTO report (
>   SELECT * FROM temptable s1 EXCEPT
>   SELECT * FROM report s2 WHERE s2.title = report.title);
>

i think you're essentially doing:

INSERT INTO report (
    SELECT * FROM temptable s1 EXCEPT
    SELECT * FROM report s2, report WHERE s2.title = report.title);

which i don't think is what you expected to happen*, but seems to be
pretty much equivalent in this case.



*given that missing-from behaves differently with inserts and updates, i
can see how this is pretty confusing... in 7.4 theres an option to turn
this off, though you'd need to think of another way to do what your
doing above since it would break


Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: return next in recursive function
Следующее
От: "Roberto de Amorim"
Дата:
Сообщение: Case Tool for PostgreSQL