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
Why do we use subquery?
Can we use having without group by in sql?
What are sql commands?
What is right join in sql?
What are the different types of sql commands?
Can you load data into multiple tables at once? : aql loader
Is sql better than excel?
Is it possible to remove child records without removing master table records...the two having pk,fk relationship?
What is trigger with example?
What is pl sql variable?
what is cursor. write example of it. What are the attributes of cursor.
what does myisamchk do? : Sql dba
how to create a new table by selecting rows from another table in mysql? : Sql dba
what are the authentication modes in sql server? : Sql dba
What is application trigger?