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
Determine if oracle date is on a weekend?
What is dynamic query?
Explain the the delete statements in sql?
how to see the create table statement of an existing table? : Sql dba
Is truncate ddl or dml?
Can there be 2 primary keys in a table?
what is auto increment? : Sql dba
Is there any restriction on the use of union in embedded sql?
What is trigger point?
What is the size of partition table?
What is an escape character in sql?
What is procedure explain with program?
what happens if null values are involved in expressions? : Sql dba
Which is better join or inner query?
Can we perform dml in function?