Re: [HACKERS] Table aliases in delete statements?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Keith Parks <emkxp01(at)mtcc(dot)demon(dot)co(dot)uk>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Table aliases in delete statements?
Date: 1999-12-08 00:23:55
Message-ID: 199912080023.TAA15217@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-12-08 00:31:17 Re: [HACKERS] Raising funds for PostgreSQL
Previous Message Bruce Momjian 1999-12-07 23:16:17 Re: (resolution?) Re: [HACKERS] memory problem again