September 23, 2008 at 3:04 am
SQL DB
I want to swap data around from one column to another.
I have a table called 'PandL' and Im looking at the following data:
SELECT *
FROM PandL
WHERE Currency not like 'GBP'
AND Currency not like 'ZAR'
AND Date >= '04/08/08'
order by date desc
I want to swap the data from column 'Local' to 'Foreign' and vis versa.
Whats the easiest way to do this?
Thanks
September 23, 2008 at 3:16 am
pri.amin (9/23/2008)
SQL DBI want to swap data around from one column to another.
I have a table called 'PandL' and Im looking at the following data:
SELECT *
FROM PandL
WHERE Currency not like 'GBP'
AND Currency not like 'ZAR'
AND Date >= '04/08/08'
order by date desc
I want to swap the data from column 'Local' to 'Foreign' and vis versa.
Whats the easiest way to do this?
Thanks
update PandL
set Local =Foreign ,Foreign =Local
WHERE Currency not like 'GBP'
AND Currency not like 'ZAR'
AND Date >= '04/08/08'
Failing to plan is Planning to fail
September 23, 2008 at 3:45 am
Thanks very much, worked well!! 🙂
September 24, 2008 at 2:04 am
pri.amin (9/23/2008)
Thanks very much, worked well!! 🙂
You are welcome 🙂
Failing to plan is Planning to fail
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply