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

What are the different set operators available in sql?

1009


what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba

940


Explain spool.

1161


What is %rowtype in pl sql?

975


how to decrement dates by 1 in mysql? : Sql dba

1007


What is sql data?

974


What is a pl/sql block?

1199


What makes a good primary key?

1014


What is row_number () in sql?

964


What are the basic techniques of indexing?

1049


how many ways we can we find the current date using mysql? : Sql dba

1079


What is pl sql commands?

1024


what are rollup and cube in t-sql? : Transact sql

1072


Explain the commit statement.

1141


What is meant by temporal data?

945