Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A47002E0351 for ; Wed, 12 Mar 2008 13:02:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 51414-02 for ; Wed, 12 Mar 2008 13:01:54 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by postgresql.org (Postfix) with ESMTP id CE3F92E0221 for ; Wed, 12 Mar 2008 13:01:53 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id m38so3523587waf.5 for ; Wed, 12 Mar 2008 09:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=AiSIXutK2hzNDdGUY+XLueww4T+W5Ie3uYt4SYyiwwM=; b=DJKkF8lywXMvIaMbQT+H+5Ywa9nkM3Iz4bhgT4GbfywigrrAdU7T0r+T/Bglhe8ZG+v9fMepdeWymxk8+9Hoyam/pXw51A8xtgLkNWEhLPcFPJZxP6j7Hjc93C4gTRu3j7dMeK5eE9NnrbePJcb/2L0QD7FgLe09vsr57/0I5jQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=f9tQRL53TWzVY/1evZ1JpAJN3tZAl+W0ZvuvoO614JqcRDtU2mJ3QQEfuq5HwuX+ee0lk+53pjosZHNjHZO+VVhTjljH6kt2j7Os+T7mQ+Z74EJofwVv5rhphsyOaJ3sMh9UGeJiY+UOXVbKxUDa1kjJ7GZIba0JBkT2+s0sAfA= Received: by 10.115.79.1 with SMTP id g1mr7537772wal.2.1205337711909; Wed, 12 Mar 2008 09:01:51 -0700 (PDT) Received: by 10.114.133.6 with HTTP; Wed, 12 Mar 2008 09:01:51 -0700 (PDT) Message-ID: Date: Wed, 12 Mar 2008 09:01:51 -0700 From: "Scott Marlowe" To: emilu@encs.concordia.ca Subject: Re: case when... end in update clause? Cc: pgsql-sql@postgresql.org In-Reply-To: <47D7FB06.10707@encs.concordia.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47D7FB06.10707@encs.concordia.ca> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/57 X-Sequence-Number: 30385 On Wed, Mar 12, 2008 at 8:47 AM, Emi Lu wrote: > Hello, > > May I know can "case when " used by update clause. If yes, how? > > I use one small Example, table: test > ============================= > id > == > 5 > 6 > 8 > > try to update test.id > > > update test > > case > when id =5 then SET id = 6 > end > ; would this work: update test set id=5 where id=6; ???