Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: is this possible to do in one sql

RE: is this possible to do in one sql

From: Looney, Jason <Jason.Looney_at_echostar.com>
Date: Fri, 17 Dec 2004 11:04:22 -0700
Message-ID: <B8C9CF34B3F7164282C8610C93BB94AF04C63619@riv-exchb1.echostar.com>


--I have both oracle 8i and 9i running. I want to update two columns in a
--table with two different conditions. Is it possible to do it as one sql
--statment?

Sure. Try this:

UPDATE t1 SET
  NOTFLAG = DECODE(NOTFLAG, '1', NULL, NOTFLAG),   EVIDENCE = DECODE(EVIDENCE, '2', NULL, EVIDENCE) /

Jason.

--

http://www.freelists.org/webpage/oracle-l Received on Fri Dec 17 2004 - 12:02:36 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US