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

what are the types of join and explain each? : Sql dba

1048


what is the difference between a having clause and a where clause? : Sql dba

1099


Why do we go for stored procedures?

1068


How many types of tables are there?

962


how is exception handling handled in mysql? : Sql dba

1091


What is blind sql injection?

1082


What is pl/sql language case sensitive?

1139


What is benefit of creating memory optimized table?

984


Who is the owner of mysql database?

1067


What is a primary key? Explain

991


Can we use loop in sql?

974


What is sql server and ase?

1037


List the ways to get the count of records in a table?

904


Which is better join or inner query?

1066


How to test for null values?

1060