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 sql commands?

1075


What does the argument [or replace] do?

1088


How delete all data from all tables in sql?

950


How do I partition in sql?

967


Is oracle sql free?

991


Is not null in sql?

1000


Is the primary key an index?

1026


what are the differences between require and include, include_once and require_once? : Sql dba

1027


define join and explain different type of joins? : Sql dba

954


What are different types of functions in sql?

1006


Which tcp/ip port does sql server run on? How can it be changed? : Sql dba

1004


What are secondary keys?

972


Explain the working of foreign key?

1070


How many sectors are in a partition?

1076


What is equi join in sql?

1082