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


Please Help Members By Posting Answers For Below Questions

What are sql triggers used for?

503


Can there be more than one function with a similar name in a pl/sql block?

536


What does sign mean sql?

561


What is trigger types in sql?

526


Lookups are a key component in sql server integration services (ssis). Explain its purpose?

527






How to write pl sql program in mysql command prompt?

507


What are its different types of dbms?

531


what are the types of subquery? : Sql dba

577


How can you know that statistics should be updated?

595


What is scalar data type in pl sql?

544


how is myisam table stored? : Sql dba

598


What is a data definition language?

546


What is a variable in sql?

507


Can we join same table in sql?

517


How much ram can sql express use?

499