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


Please Help Members By Posting Answers For Below Questions

What is type and rowtype in pl sql?

530


What is the difference between function, procedure and package in pl/sql?

553


what is normalization? : Sql dba

559


What is implicit cursor in pl sql?

533


What is auto increment?

575






What jobs use sql?

520


What is a .db file?

531


What is trigger and how to use it in sql?

529


What does t sql mean?

525


Is sql scripting language?

519


What is the difference between clustered and non-clustered indexes?

593


How do I view a procedure in sql?

541


How to change sql*plus system settings?

534


i have a column which may contain this kind of value: 123*67_80,12*8889_5,34*8_874 ,12*7_7 (can contain space before a comma, and this string length can be anything) now i want to split this value into two column like: column1: 123*67,12*8889,34*8,12*7 column2: 80,5,874,7 use function for this

1053


What is pessimistic concurrency control? : Transact sql

581