Jens Hartwig <[EMAIL PROTECTED]> writes:
> I have never seen a statement like
> SELECT a, (SELECT b)
> FROM xyz;
> IMHO this is no normal subselect and it does not correlate with the
> SQL-standard. Is it a trick?
I think it's OK (we're assuming that a and b are columns of xyz, right?)
The inner select sees values from the outer select as constants. This
is not really different from
SELECT x FROM xyz WHERE y IN
(SELECT a FROM abc WHERE b = xyz.z);
where the inner WHERE relies upon an outer reference to the current
xyz tuple.
It is true that "SELECT b" isn't a valid SQL92 SELECT because it
hasn't got a FROM clause, but that's a minor quibble that just about
every vendor has invented a workaround for.
regards, tom lane
- [SQL] how to build this query ??? Please help !!! juerg . rietmann
- Sv: [SQL] how to build this query ??? Please help ... Nikolaj Lundsgaard
- Re: Sv: [SQL] how to build this query ??? Plea... Jens Hartwig
- Re: Sv: [SQL] how to build this query ??? ... Tod McQuillin
- Re: Sv: [SQL] how to build this query ... Tom Lane
- Re: Sv: [SQL] how to build this query ... Jens Hartwig
- Re: Sv: [SQL] how to build this q... Tom Lane
- Re: Sv: [SQL] how to build th... Jens Hartwig
- Re: Sv: [SQL] how to buil... Tod McQuillin
- Re: Sv: [SQL] how to buil... Robert B. Easter
- Re: Sv: [SQL] how to buil... Robert B. Easter
- Re: Sv: [SQL] how to buil... Tom Lane
- Re: Sv: [SQL] how to buil... Tom Lane
