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 / lova raju allumalla
update T set A=B,B=A where A in (select A from T);
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How many sql core licenses do I need?
Can two tables have same primary key?
Is clustered index a primary key?
What is difference between ms sql and mysql?
Why is sharding used?
What is the usage of when clause in trigger?
Why functions are used in sql?
Can we insert data into view?
How do I view stored procedures?
What is the unique index?
How to raise user-defined exception with custom sqlerrm ?
How do I remove all records from a table?
Explain the uses of a database trigger?
How can we store rows in PL/SQL using array?
Which join is like inner join?