Re: [HACKERS] Table aliases in delete statements? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Table aliases in delete statements?
Date
Msg-id 199912080023.TAA15217@candle.pha.pa.us
Whole thread Raw
In response to Table aliases in delete statements?  (Keith Parks <emkxp01@mtcc.demon.co.uk>)
List pgsql-hackers
> emkxp01=> delete from deltest s1 where s1.respdate not in ( select 
> min(s2.respdate) from deltest s2 where s1.sessionid = s2.sessionid);
> ERROR:  parser: parse error at or near "s1"
> emkxp01=> 

Don't use s1.  Just refer to native deltest in the subquery.  That
should reference the outer table.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: (resolution?) Re: [HACKERS] memory problem again
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Raising funds for PostgreSQL