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 / lova raju allumalla

update T set A=B,B=A where A in (select A from T);

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

when MSQL8.0 is in market

2144


What are hotfixes and patches?

986


How can we find duplicate records in a table?

995


what are the different index configurations a table can have? : Sql dba

1042


Is natural join and inner join same?

993


What is the difference between explicit and implicit cursors in oracle?

1115


what is column? : Sql dba

1052


What does sign mean sql?

1183


What is dynamic query?

1036


What are predefined functions in sql?

1109


What is the most common sql injection tool?

1091


Are subqueries better than joins?

1041


what happens if you no create privilege in a database? : Sql dba

1050


Can we use loop in sql?

1010


What is the non-clustered index in sql?

1108