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 types of join and explain each? : Sql dba
what is the difference between a having clause and a where clause? : Sql dba
Why do we go for stored procedures?
How many types of tables are there?
how is exception handling handled in mysql? : Sql dba
What is blind sql injection?
What is pl/sql language case sensitive?
What is benefit of creating memory optimized table?
Who is the owner of mysql database?
What is a primary key? Explain
Can we use loop in sql?
What is sql server and ase?
List the ways to get the count of records in a table?
Which is better join or inner query?
How to test for null values?