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
when MSQL8.0 is in market
What are hotfixes and patches?
How can we find duplicate records in a table?
what are the different index configurations a table can have? : Sql dba
Is natural join and inner join same?
What is the difference between explicit and implicit cursors in oracle?
what is column? : Sql dba
What does sign mean sql?
What is dynamic query?
What are predefined functions in sql?
What is the most common sql injection tool?
Are subqueries better than joins?
what happens if you no create privilege in a database? : Sql dba
Can we use loop in sql?
What is the non-clustered index in sql?