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
Is there a 64 bit version of ssms?
What is duration in sql profiler trace?
What is pessimistic concurrency control? : Transact sql
What is view? Can we update view
what is heap table? : Sql dba
What are analytic functions in sql?
Is sql easier than java?
What does where 1/2 mean in sql?
how to install mysql? : Sql dba
how many ways we can we find the current date using mysql? : Sql dba
Is a table valued function object?
What do you mean by “trigger” in sql?
What are types of exception?
What is the advantage of index in sql?
what is an alias command? : Sql dba