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
What are the different sql commands?
What does the argument [or replace] do?
How delete all data from all tables in sql?
How do I partition in sql?
Is oracle sql free?
Is not null in sql?
Is the primary key an index?
what are the differences between require and include, include_once and require_once? : Sql dba
define join and explain different type of joins? : Sql dba
What are different types of functions in sql?
Which tcp/ip port does sql server run on? How can it be changed? : Sql dba
What are secondary keys?
Explain the working of foreign key?
How many sectors are in a partition?
What is equi join in sql?