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 / bunty

UPDATE T
SET A = B,B=A;

I am surprized but above query will fetch the desired
result.

Cheers,
Bunty

Is This Answer Correct ?    30 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a database trigger?

599


How do I run a query in pl sql developer?

550


How to combine two stored procedures in sql?

584


What is sql server and ase?

530


Why trigger is used in sql?

521






What is java sql package?

524


Is sql dba a good career? : SQL DBA

523


What is sql resultset?

521


what is table? : Sql dba

566


What is integrity in sql?

547


What is the location of pre_defined_functions.

634


What is procedure explain with program?

544


What is attribute indicator in pl sql?

514


What is scope of pl sql developer in future?

582


what is denormalization. : Sql dba

536