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
How much ram can sql express use?
write an sql query to find names of employee start with 'a'? : Sql dba
What is bind variable in pl sql?
How do you define a foreign key?
How many databases can sql express handle?
What does varchar include?
Is pl sql still used?
What is the difference between a primary key and a clustered index?
What are synonyms in sql?
ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..
Explain what is a view?
What is the difference between local and global temporary table?
What is cursor explain with example?
Is sql sequential or random?
what is the difference between ereg_replace() and eregi_replace()? : Sql dba