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 do you know the version of your mysql server? : Sql dba
What are all the ddl commands?
Explain character-manipulation functions?
Can a table contain multiple foreign key’s?
How do I remove sql plus from windows 10?
How do I count rows in sql query?
How can I get the number of records affected by a stored procedure?
How do I add a database to sql?
What are the ddl commands?
How can I change database name in sql?
What is auto increment in sql?
What is difference between ms sql and mysql?
What are the sql commands?
How insert into statements in sql?
What is difference between group by and partition by?