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

Why do we use subquery?

1009


Can we use having without group by in sql?

982


What are sql commands?

1010


What is right join in sql?

1086


What are the different types of sql commands?

1123


Can you load data into multiple tables at once? : aql loader

1066


Is sql better than excel?

1147


Is it possible to remove child records without removing master table records...the two having pk,fk relationship?

1264


What is trigger with example?

1092


What is pl sql variable?

981


what is cursor. write example of it. What are the attributes of cursor.

1381


what does myisamchk do? : Sql dba

1010


how to create a new table by selecting rows from another table in mysql? : Sql dba

1085


what are the authentication modes in sql server? : Sql dba

1060


What is application trigger?

992