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 is sql procedures and functions?

1071


how can you create an empty table from an existing table? : Sql dba

1192


What is a join?

1104


What is left join example?

1007


Which is faster joins or subqueries?

1033


how tsql statements can be written and submitted to the database engine? : Transact sql

1034


How do I run a script in sql developer?

995


What does fetching a cursor do?

1131


what is collation? : Sql dba

1198


What is a primary key called that is made up of more than one field?

1393


What does the base_object_type column shows in the user.triggers data dictionary view?

1094


Is grant a ddl statement?

939


How to change the order of columns in Oracle SQL Plus ?

1100


How do I run a pl sql program?

1189


Define tables and fields in a database

1175