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 myisam tables? : Sql dba
What is union and union all keyword in sql?
Can delete statement be rollbacked?
Can we use joins in subquery?
Is sql microsoft?
Does sql backup shrink transaction log?
How to display the current date in sql?
What is implicit cursor in pl sql?
What is the use of prepared statement?
Is mariadb a nosql database?
What are sql procedures?
What is the difference between partitioning and sharding?
what is the functionality of the function htmlentities? : Sql dba
Can we use ddl statements in stored procedure?
What is the purpose of the primary key?