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 is sql procedures and functions?
how can you create an empty table from an existing table? : Sql dba
What is a join?
What is left join example?
Which is faster joins or subqueries?
how tsql statements can be written and submitted to the database engine? : Transact sql
How do I run a script in sql developer?
What does fetching a cursor do?
what is collation? : Sql dba
What is a primary key called that is made up of more than one field?
What does the base_object_type column shows in the user.triggers data dictionary view?
Is grant a ddl statement?
How to change the order of columns in Oracle SQL Plus ?
How do I run a pl sql program?
Define tables and fields in a database