If I have a table T with 4 rows & 2 columns A & B. A has
values 1,2,3,4. and B has 10,20,30,40. Write an Update SQL
query which can Swap the values of A & B for all records.
(Do not use a sub-query)
Answer Posted / bunty
UPDATE T
SET A = B,B=A;
I am surprized but above query will fetch the desired
result.
Cheers,
Bunty
| Is This Answer Correct ? | 30 Yes | 1 No |
Post New Answer View All Answers
What is the difference between the repeatable read and serializable isolation levels? : Transact sql
What is the basic form of sql query?
Which kind of parameters cannot have a default value in pl sql?
How does sql store data?
How do you create a db file?
Why do we use cursors?
Can we rename a column in the output of sql query?
Can we use pl sql in sql server?
What is difference between table and view?
Explian rowid, rownum?
Is sql developer case sensitive?
What is the difference between alter trigger and drop trigger statements?
When sql appeared?
What does pragma mean?
What is procedure and function?