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
How to write pl sql program in mysql command prompt?
When is the explicit cursor used ?
How do I view a sql trace file?
Will truncate release space?
What is the difference between the conventional and direct path loader? : aql loader
How can triggers be used for the table auditing?
What does truncate mean in sql?
how do you control the max size of a heap table? : Sql dba
What is the difference between nvl function, ifnull function, and isnull function?
How can you select unique records from a table?
Can a varchar be a primary key?
Define commit, rollback and savepoint?
which operator is used in query for pattern matching? : Sql dba
What is varchar example?
How do you declare a constant?