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

How many sql core licenses do I need?

881


Can two tables have same primary key?

915


Is clustered index a primary key?

882


What is difference between ms sql and mysql?

909


Why is sharding used?

939


What is the usage of when clause in trigger?

989


Why functions are used in sql?

927


Can we insert data into view?

847


How do I view stored procedures?

915


What is the unique index?

1002


How to raise user-defined exception with custom sqlerrm ?

1060


How do I remove all records from a table?

1023


Explain the uses of a database trigger?

981


How can we store rows in PL/SQL using array?

1159


Which join is like inner join?

974