Re: Mested select into the from of a a Select structure

Поиск
Список
Период
Сортировка
От Jakub Ouhrabka
Тема Re: Mested select into the from of a a Select structure
Дата
Msg-id Pine.LNX.4.44.0211091758040.14308-100000@server
обсуждение исходный текст
Ответ на Mested select into the from of a a Select structure  (Tourtounis Sotiris <tourtoun@csd.uoc.gr>)
Список pgsql-general
hi,

try:

select *
from (select Y.col1 AS X from ....) Z, T
where  T.col2 = Z.X

'Z' is a table alias in your case, not column alias...

kuba

On Sat, 9 Nov 2002, Tourtounis Sotiris wrote:

>
> Performing an SQL query of the below general form to a table T
>
> Table T :
>
> col1 | col2 | col3
> ------------------
> text | text | text
>
> and the query is ...
>
> select *
> from (select Y.col1 from ....) Z, T
> where  T.col2 = Z
>
> I think this query should work - however it throws me an error to the
> where clause, where it says that it doesn't find Z (ERROR:  Attribute 'z'
> not found) - can anyone notice any mistake or overlap that i have made - i
> would really appreciate any kind of help or advice - thank you a priori
> !!!
>
>
>
>                                                  SWTHRHS TOYRTOYNHS
>                                                 (tourtoun@csd.uch.gr)
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>


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

Предыдущее
От: snpe
Дата:
Сообщение: PostgreSQL JDBC and sub-select
Следующее
От: Neil Conway
Дата:
Сообщение: Re: Upgrade to dual processor machine?