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...

If I have a table T with 4 rows & 2 columns A & B. A has
values 1,2,3,4. and B has 10,20,30,40. Write an Update SQL
query which can Swap the values of A & B for all records.
(Do not use a sub-query)

Answer Posted / bunty

UPDATE T
SET A = B,B=A;

I am surprized but above query will fetch the desired
result.

Cheers,
Bunty

Is This Answer Correct ?    30 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write pl sql program in mysql command prompt?

1068


When is the explicit cursor used ?

1011


How do I view a sql trace file?

1006


Will truncate release space?

929


What is the difference between the conventional and direct path loader? : aql loader

1142


How can triggers be used for the table auditing?

1049


What does truncate mean in sql?

1002


how do you control the max size of a heap table? : Sql dba

960


What is the difference between nvl function, ifnull function, and isnull function?

1087


How can you select unique records from a table?

1054


Can a varchar be a primary key?

993


Define commit, rollback and savepoint?

1016


which operator is used in query for pattern matching? : Sql dba

986


What is varchar example?

1013


How do you declare a constant?

947