Re: Subselects, the Oracle way

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Subselects, the Oracle way
Дата
Msg-id 01d901c0f833$ccef28a0$48d210ac@jecw2k1
обсуждение исходный текст
Ответ на Subselects, the Oracle way  ("Svenne Krap" <svenne@krap.dk>)
Список pgsql-sql
> Is there any way to mimic the oracle way of subselect, especially
> constructs like
>
>
> select * from (select col1 as x, col2, col6 from t1 union select col2
> as x, col6, col2 from t2) y order by y.x
>

Works fine as written in version 7.1 and above. See
http://www.postgresql.org/idocs/index.php?queries.html#QUERIES-FROM

test=# select version();                             version
-------------------------------------------------------------------PostgreSQL 7.1 on i686-pc-linux-gnu, compiled by GCC
egcs-2.91.66
(1 row)

test=# select * from (select col1 as x, col2, col6 from t1 union select col2
as x, col6, col2 from t2) y order by y.x;x | col2 | col6
---+------+------1 |    1 |    12 |    2 |    23 |    3 |    34 |    4 |    4
(4 rows)

-- Joe



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: LEFT JOIN ...
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: LEFT JOIN ...