Home » SQL & PL/SQL » SQL & PL/SQL » SQL Query - Urgent
SQL Query - Urgent [message #23323] Mon, 02 December 2002 01:02 Go to next message
venkatesh
Messages: 72
Registered: August 2000
Member
hi all,

i have a table like this:

select * from t1;

ID GRADE
------ ----------
1 1
2 1
3 2
4 2

and i wanna update the GRADE column...
the condition is i wanna update Grade 1 as 2 and 2 as 1 in a single query...
how do i do this...? somebody help me plz....

regards
venkatesh
Re: SQL Query - Urgent [message #23324 is a reply to message #23323] Mon, 02 December 2002 02:15 Go to previous message
Deepa
Messages: 269
Registered: November 2000
Senior Member
update t1 set grade=decode(grader,1,2,2,1)

Replace 1 with 2 and 2 with 1
Previous Topic: time problem
Next Topic: function values and fun query
Goto Forum:
  


Current Time: Wed May 15 05:47:14 CDT 2024