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 create a new table in mysql? : Sql dba
Name the different types of indexes in sql and define them.
how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba
How to select random rows from a table?
what is the bond code in materialized view?
Explain what is a subquery ?
What is the importance of sqlcode and sqlerrm?
what are tables and fields? : Sql dba
What is pls integer?
Why do we use subquery?
How much does a sql dba make? : SQL DBA
What are the three forms of normalization?
What is the difference between a primary key and a unique key?
Why do we need unique key in a table?
How is sql used in oracle?