Swapping the values .. please help

Hi,
I have a table called emp_sal_details, in which I do have empno, ename, curr_sal (current month salary), prev_sal (previous month salary) as colulmns .. What my programmer did was, he has put current month salary into previous month salary column and previous month salary into current month salary ( I mean the values), now with sql statement, I want to SWAP the values .. how can I do that that too without creating any interim table or any other table? Apart from SQL, can we also use PL/SQL here ?? If so, how
Regards
Message was edited by:
user463477

You can do that with a single update stmt.
Please this exercise as a clue and apply same logic for ur table(s).
create table t11(c1 number,c2 number);
insert into t11 values(1,2); commit;
update t11 set c1=c2, c2=c1;
select * from t11
output:
c1 c2
2 1
Cheers
Ravikanth

Similar Messages

Maybe you are looking for

  • Restore needed but wont restore HELP PLEASE

    my iphone keeps saying restore needed, iphone can not make calls or recieve calls restore on itunes phone says no service all the time, but iphone will not restore on itunes loads half way then stops, ive even tryed to restore settings on my phone ma

  • Os x 10.8.3 bootcamp reverse scroll direction

    I just installed 10.8.3 on my retina and the new windows 8 driver with a fresh bootcamp install.  Good news is the bluetooth works to keyboard and trackpad, both my external thunderbolt monitors work, the resolution is now correct at 2880x1880. Only

  • File transfer to K-1 from Linux Mint

    Hi, I've had my K-1 for just two days now and it's prompted me for updates 5 or 6 time What's with that? It seems that at least one of these bumped me up to Android 3.2. Right now my main issue is that when I plug the usb cable to my laptop to transf

  • How to persist updated DataGridTemplateColumn value

    I am new to WPF and facing some issues with datagrid . My ViewModel has an ObservableCollection Report Of class T_Reports. //EF generated code  public partial class T_Reports         public int ReportID { get; set; }         public string ReportName

  • I Pod classic 160 gb Battery Problem

    Right my problem is that my battery went low with the message 'connect to power' so i connected it to a usb power adapter,it says it's charging and the menu comes and u can play music when its connected,ive had it on charge on the usb power adapter f