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
What are triggers in sql?
How do you get column names only for a table (sql server)?
What is the use of procedures?
Explain the difference between triggers and constraints?
What is memory optimized table?
What are the advantages of normalization?
How many sectors are in a partition?
How do you write a subquery?
Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?
Why do we need unique key in a table?
How do you optimize a query?
What is an invalid partition table?
How do you create a unique index?
What is a unique key and primary key and foreign key?
How is indexing done in search engines?