Re: subselects - Mailing list pgsql-hackers

From Zeugswetter Andreas DBT
Subject Re: subselects
Date
Msg-id 219F68D65015D011A8E000006F8590C6010A51A2@sdexcsrv1.sd.spardat.at
Whole thread Raw
In response to subselects  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Re: subselects
List pgsql-hackers
Bruce wrote:
> I have completed adding Var.varlevelsup, and have added code to the
> parser to properly set the field.  It will allow correlated references
> in the WHERE clause, but not in the target list.

select i2.ip1, i1.ip4 from nameip i1 where ip1 = (select ip1 from nameip
i2);
   522: Table (i2) not selected in query.
select i1.ip4 from nameip i1 where ip1 = (select i1.ip1 from nameip i2);
   284: A subquery has returned not exactly one row.
select i1.ip4 from nameip i1 where ip1 = (select i1.ip1 from nameip i2
where name='zeus');
 2 row(s) retrieved.

Informix allows correlated references in the target list. It also allows
subselects in the target list as in:
select i1.ip4, (select i1.ip1 from nameip i2) from nameip i1;
   284: A subquery has returned not exactly one row.
select i1.ip4, (select i1.ip1 from nameip i2 where name='zeus') from
nameip i1;
 2 row(s) retrieved.

Is this what you were looking for ?

Andreas

pgsql-hackers by date:

Previous
From: Maarten Boekhold
Date:
Subject: Re: [HACKERS] Authentication Woes
Next
From: "Vadim B. Mikheev"
Date:
Subject: Re: subselects