Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: is this possible to do in one sql
This will work :
update t1
set NOTFLAG=decode(NOTFLAG,'1',null,NOTFLAG},
EVIDENCE=decode(EVIDENCE,'2',null,EVIDENCE)
where NOTFLAG = '1' or EVIDENCE='2';
-----Original Message-----
From: Guang Mei [mailto:gmei_at_incyte.com]
Sent: Friday, December 17, 2004 12:01 PM
To: Oracle-L-freelists
Subject: is this possible to do in one sql
Hi,
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?
For example,
create table t1 (NOTFLAG CHAR(1), EVIDENCE CHAR(1));
insert into t1 (NOTFLAG,EVIDENCE ) values ('1','1'); insert into t1 (NOTFLAG,EVIDENCE ) values ('2','2'); commit;
select * from t1;
Thanks,
Guang
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Dec 17 2004 - 12:15:40 CST
![]() |
![]() |