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

Which command is used to call a stored procedure?

493


What is the use of triggers?

538


Can we insert in sql function?

534


What is Collation Sensitivity ? What are the various type ?

493


explain what is mysql? : Sql dba

592






What do you understand by exception handling in pl/sql?

571


Why do we create views in sql?

548


what is the difference between delete and truncate commands? : Sql dba

531


Is left join and outer join same?

541


What do you think about pl/sql?

526


How do you declare a user-defined exception?

523


what are the performance and scalability characteristics of mysql? : Sql dba

523


What is full form of rtm?

528


what is subquery? : Sql dba

564


Why is sql better than hql?

502