| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> | 
| Cc: | Hamid Khoshnevis <hamid(at)emarq(dot)com>, pgsql-sql(at)postgreSQL(dot)org | 
| Subject: | Re: [SQL] Using intersect in subquery | 
| Date: | 1999-08-18 13:51:29 | 
| Message-ID: | 24554.934984289@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-sql | 
Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> writes:
> Try 6.5.  We fixed some Intersect stuff.
>> 
>> select * from Table1
>> where KeyField1 in
>> (select KeyField2 from Table2 where  somecondition
>> intersect
>> select KeyField3 from Table3  where somecondition);
>> 
>> (I believe) I am running PG 6.4.  The INTERSECT by itself works, but not in
>> a subquery.
>> 
No, it still won't work --- the current grammar specifies SubSelect not
select_clause as the kind of select you can put inside an expression.
Not sure what it would take to fix this; I have a feeling that just
changing the grammar wouldn't be good enough :-(.  Better add it to the
TODO list:
	* Support UNION/INTERSECT/EXCEPT in sub-selects
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Herouth Maoz | 1999-08-18 14:21:39 | Re: [SQL] Using intersect in subquery | 
| Previous Message | Tom Lane | 1999-08-18 13:43:51 | Re: [SQL] CASE statement causes unknown node type 723 |