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
What is sql and db2?
What does plv msg allows you to do?
Why partition by is used in sql?
Why we use stored procedure instead of query?
How to select random rows from a table?
What is on delete set null?
GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?
What is a sql select statement?
What are hotfixes and patches?
What does desc stand for?
How to sort the rows in sql.
What is pl sql block structure?
What is normalisation and its types?
What are the advantages of pl sql?
Which are the different character-manipulation functions in sql?