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 / preeti mishra

update T
set A:=A+B,
B:=A-B,
A:=A-B;

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is user in sql?

764


Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?

3311


What are the types of sql commands?

745


What is form and report?

715


What is audit logout in sql profiler?

764






What are the different ways to optimize a sql query?

679


List the different type of joins?

752


What is sql select statement?

703


Is sql dba a good career? : SQL DBA

712


How many types of triggers are there in pl sql?

781


What is the sql*loader? : aql loader

779


what is rdbms? : Sql dba

759


What is interval partition?

724


How many triggers can be applied to a table?

782


Can a select statement fire a trigger?

888