Received: from ibi.metrocom.ru (ibi.metrocom.ru [195.5.154.130]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA31186 for ; Fri, 7 Apr 2000 08:04:34 -0400 (EDT) (envelope-from kl@84105.aanet.ru) Received: from 192.168.11.101 (ip-523.fixed.cl.spb.ru [212.46.199.9]) by ibi.metrocom.ru (8.9.3/8.9.3/IBI) with SMTP id QAA27353; Fri, 7 Apr 2000 16:04:26 +0400 (envelope-from kl@84105.aanet.ru) Date: Fri, 7 Apr 2000 16:04:18 +0400 From: "Leonid P. Klemjatsionok" X-Mailer: The Bat! (v1.039) S/N 4F39C051 Reply-To: "Leonid P. Klemjatsionok" Message-ID: <2669.000407@84105.aanet.ru> To: "Moray McConnachie" CC: pgsql-sql@postgresql.org Subject: Re[2]: update only if single row References: <006001bfa06d$d45f5480$760e01a3@oucs.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200004/67 MM> I'm not quite sure that the aliasing works properly in this query either - MM> does the EXISTS clause pick up the a alias? MM> UPDATE contact a SET a.bounce=1 WHERE a.email ~* 'rvro' AND NOT EXISTS MM> (SELECT id FROM contact b WHERE b.email ~*'rvro' AND a.id !=b.id); Aliasing does not work properly on v6.5. You can use full name. UPDATE contact SET bounce=1 WHERE email ~* 'rvro' AND NOT EXISTS (SELECT * FROM contact b WHERE b.email ~* 'rvro' AND contact.id != b.id); Best regards, LPK Station mailto:kl@84105.aanet.ru