| Ratnaker |
Posted: May 18, 2007 07:47:41 AM |
Total Post: 141
Joined: Apr, 2007
|
Hi,
I designed one table :
Contact
contID Code1 Code2
------ ----- ------
1 A B
2 A B
3 A B
4 A B
i want to update A to B and B to A in One Update Statement. Please give solution.
Ratnaker |
|
|
sudha |
| Posted: May 18, 2007 12:57:35 PM | |
|
Total Post: 15
Joined: Jan, 2007
|
hi kp
update contact set code1 = 'B',code2 = 'A'
where code1 ='A' and code2 = 'B';
-Sudha
|
|
|
|
|
Ratnaker |
| Posted: May 21, 2007 12:54:38 AM | |
|
Total Post: 141
Joined: Apr, 2007
|
Hi Sudha,
Its very usefule for me.
Thank you very much
Ratnaker
|
|
|
|
|
Ratnaker |
| Posted: May 21, 2007 01:36:01 AM | |
|
Total Post: 141
Joined: Apr, 2007
|
Hi,
I designed one table :
Contact
contID Code1
------ -----
1 A
2 A
3 B
4 B
i want to update A to B and B to A in One Update Statement. Please give solution
|
|
|
|
|
dipali |
| Posted: May 21, 2007 02:45:03 AM | |
|
Total Post: 35
Joined: Dec, 2006
|
i don't think it's possible in one query..
|
|
|
|
|
Ratnaker |
| Posted: May 29, 2007 07:04:30 AM | |
|
Total Post: 141
Joined: Apr, 2007
|
Hi Sudha,dipali and all my forum friends
you can do. It is possible:
update t set code1 = decode( code1, 'A', 'B', 'B', 'A' ) where code1 in ( 'A', 'B' );
Ratnaker
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |