there are 2 variables called x and y ,x contains 1,2 and y
contains 3,4 we have to swap the values from x to y and y
to x with out using dummy variables and it can be done only
by using a single statement ? how?
Answer Posted / raji_4u
IF YOU WANT TO UPDATE THE TABLE,
UPDATE TABLE_NAME
SET X = Y, Y = X;
--------------------------
IF YOU WANT TO JUST DISPLAY,
SELECT Y X,X Y FROM TABLE_NAME;
ISN'T THIS SIMPLE THAN SANTHI.K DID.
Is This Answer Correct ? | 5 Yes | 7 No |
Post New Answer View All Answers
What is normalization in sql?
Can one improve the performance of sql*loader? : aql loader
What are all the different normalizations?
How can you get sql*loader to commit only at the end of the load file? : aql loader
What is your daily office routine?
Define concurrency control. : Transact sql
Define SQL and state the differences between SQL and other conventional programming Languages?
when is the use of update_statistics command? : Sql dba
Is json a nosql?
What is difference between pl and sql?
What is integrity in sql?
Give the order of sql select?
What is bulk compiling in pl/sql.?
How do I write a cron which will run a sql query and mail the results to agroup?
What is an escape character in sql?