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 an index? : Sql dba
How to use boolean type in select statement?
How is data stored on a disk?
discuss about myisam index statistics collection. : Sql dba
how many columns can be used for creating index? : Sql dba
Is sql pronounced sequel or sql?
What is the main difference between sql and pl/sql?
What is trigger in pl sql with examples?
does sql support programming? : Sql dba
How do you delete duplicates in sql query using rowid?
What are the types of dbms?
What is a join?
Can we insert in view in sql?
What is sql query limit?
How does cross join work?