Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is there a way to automate sql execution from the command-line, batch job or shell script?

1016


What is embedded sql what are its advantages?

1108


Why do we use sql constraints? Which constraints we can use while creating database in sql?

1085


What is package in pl sql with an examples?

1084


How do you delete a table?

1124


column A column b | output 10 7 | 10 5 8 | 8 7 -9 | 7 3 5 | 5 0 6 | 6 Write a sql query to print such output.

7484


Which is better varchar or nvarchar?

1050


Is it possible to include an insert statement on the same table to which the trigger is assigned?

1062


How delete all data from all tables in sql?

985


What is sql and its types?

1252


What is compiled query?

1084


What is user in sql?

1074


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

1092


How would you convert date into julian date format?

1044


How do you pronounce sql?

1058