Re[2]: update only if single row

From: "Leonid P(dot) Klemjatsionok" <kl(at)84105(dot)aanet(dot)ru>
To: "Moray McConnachie" <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re[2]: update only if single row
Date: 2000-04-07 12:04:18
Message-ID: 2669.000407@84105.aanet.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(at)84105(dot)aanet(dot)ru

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Moray McConnachie 2000-04-07 12:05:05 Re: duplicates
Previous Message Patrik Kudo 2000-04-07 11:33:25 Re: duplicates