Received: from zwolle.execulink.net (zwolle.execulink.net [199.166.6.25]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA26890 for ; Thu, 6 Apr 2000 13:20:42 -0400 (EDT) (envelope-from fbax@execulink.com) Received: from bax7 (ppp94.d1-2.56k.execulink.com [209.239.20.160]) by zwolle.execulink.net (8.10.0/8.10.0) with SMTP id e36HKea28587 for ; Thu, 6 Apr 2000 13:20:40 -0400 Message-Id: <3.0.6.32.20000406132216.008a8420@execulink.com> X-Sender: fbax@execulink.com X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Thu, 06 Apr 2000 13:22:16 -0400 To: pgsql-sql@postgresql.org From: Frank Bax Subject: update only if single row Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Archive-Number: 200004/54 Here's the way I do it now: select * from contact where email ~* 'rvro'; if I get a single row in the result then I enter: update contact set bounce=1 where email ~* 'rvro'; Can I combine this into a single SQL statement with the following requirements: 1) the update is only performed if a single row is selected 2) I only enter the selection string ('rvro' in this case) once in the command? Frank