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 / lova raju allumalla
update T set A=B,B=A where A in (select A from T);
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What are the different set operators available in sql?
what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba
Explain spool.
What is %rowtype in pl sql?
how to decrement dates by 1 in mysql? : Sql dba
What is sql data?
What is a pl/sql block?
What makes a good primary key?
What is row_number () in sql?
What are the basic techniques of indexing?
how many ways we can we find the current date using mysql? : Sql dba
What is pl sql commands?
what are rollup and cube in t-sql? : Transact sql
Explain the commit statement.
What is meant by temporal data?