Re[2]: update only if single row - Mailing list pgsql-sql

From Leonid P. Klemjatsionok
Subject Re[2]: update only if single row
Date
Msg-id 2669.000407@84105.aanet.ru
Whole thread Raw
In response to Re: update only if single row  ("Moray McConnachie" <moray.mcconnachie@computing-services.oxford.ac.uk>)
List pgsql-sql
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




pgsql-sql by date:

Previous
From: Patrik Kudo
Date:
Subject: Re: duplicates
Next
From: "Moray McConnachie"
Date:
Subject: Re: duplicates