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 / bunty

UPDATE T
SET A = B,B=A;

I am surprized but above query will fetch the desired
result.

Cheers,
Bunty

Is This Answer Correct ?    30 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the non-standard sql commands supported by 'mysql'? : Sql dba

1120


What is sql and explain its components?

1067


What is the use of function in sql?

1095


What is the difference between python and sql?

1005


What are the packages in pl sql?

1011


How to use transactions efficiently : transact sql

1058


what are sequences

1748


Can we have two clustered index on a table?

1025


Does truncate release storage space?

1078


What is a pragma statement?

1262


what is the difference between join and union? : Sql dba

1113


Is and as keyword in pl sql?

961


What is flag in sql?

1036


Is sql an operating system?

1020


What is the use of non clustered index?

996