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
what are the non-standard sql commands supported by 'mysql'? : Sql dba
What is sql and explain its components?
What is the use of function in sql?
What is the difference between python and sql?
What are the packages in pl sql?
How to use transactions efficiently : transact sql
what are sequences
Can we have two clustered index on a table?
Does truncate release storage space?
What is a pragma statement?
what is the difference between join and union? : Sql dba
Is and as keyword in pl sql?
What is flag in sql?
Is sql an operating system?
What is the use of non clustered index?