Re: [SQL] What's wrong with this syntax?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: [SQL] What's wrong with this syntax?
Дата
Msg-id Pine.BSF.4.21.0107231116120.55137-100000@megazone23.bigpanda.com
обсуждение исходный текст
Список pgsql-general
I don't get a parse error for the below query (made up some table
structures with those fields) on 7.2devel, what version are you
running?


On Mon, 23 Jul 2001, Raymond Chui wrote:

>
> SELECT id_1 FROM table1 WHERE state_code IN ('AZ','DE')
> UNION
> SELECT id_1 FROM table1 WHERE zip_code IN ('12345','54321');
>
> Above SQL statement running fine.
> Now I added
>
> SELECT id_2 FROM table2 WHERE id_1 IN (
> SELECT id_1 FROM table1 WHERE state_code IN ('AZ','DE')
> UNION
> SELECT id_1 FROM table1 WHERE zip_code IN ('12345','54321')
> );
>
> Now I got parse error at or near "union"
> Please tell me what's wrong with the 2nd SQL statement.
> Thank you!



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

Предыдущее
От: Mike Finn
Дата:
Сообщение: Referential cascade technique
Следующее
От: Keith F Irwin
Дата:
Сообщение: HELP! BUG? pg_dump mucks up grant/revoke