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 has stored procedures in sql?

593


Mention what is the function that is used to transfer a pl/sql table log to a database table?

482


What is nvl?

607


What is the difference between nvl function, ifnull function, and isnull function?

583


What is the purpose of cursors in pl/sql?

631






What operators deal with null?

603


what is the difference between where clause and having clause? : Sql dba

529


What is crud diagram?

509


Explain what is an index?

580


What is string join?

546


What does joining a thread mean?

540


What is the execution plan in sql?

552


How to start the command-line sql*plus?

562


How can you view the errors encountered in a trigger?

544


What is a parameter query?

619