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 / ravin
Buddies, why are you all selecting from and updating the
tables. The question says, just two variables to be swapped
without using any extra variable and also with a single
statement.
And Ramakanth's answer is right i.e. y=x+y-(x=y) . Thats it.
^^x contains 1,2 - didn't understand though.
| Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
Is sql difficult?
explain what is mysql? : Sql dba
What are the constraints available in sql?
Are ddl triggers fired for ddl statements within a pl/sql code executed using the dbms.sql package?
explain mysql aggregate functions. : Sql dba
What is bind variable in pl sql?
What is a column in a table?
Explain 3 basic parts of a trigger.
What is java sql driver?
Is truncate ddl or dml?
Why is %isopen always false for an implicit cursor?
What is the sql*loader? : aql loader
What are the triggers associated with image items?
How many commands are there in sql?
what is bcp? When is it used?