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 / preeti mishra
update T
set A:=A+B,
B:=A-B,
A:=A-B;
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
what is query cache in mysql? : Sql dba
Explain sql data types?
What is hibernate and its relation to sql?
How do you delete data from a table?
What are the different types of joins in sql?
What is the difference between sql, mysql and sql server?
What is the use of desc in sql?
how can we find the number of rows in a table using mysql? : Sql dba
What is the difference between view and stored procedure?
What is the function that is used to transfer a pl/sql table log to a database table?
What are different categories of sql commands?
what is row? : Sql dba
What is sql select statement?
How to change the order of columns in Oracle SQL Plus ?
What is inner join in sql?