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 is the difference between the repeatable read and serializable isolation levels? : Transact sql

1014


What is the basic form of sql query?

879


Which kind of parameters cannot have a default value in pl sql?

1071


How does sql store data?

866


How do you create a db file?

957


Why do we use cursors?

919


Can we rename a column in the output of sql query?

949


Can we use pl sql in sql server?

1012


What is difference between table and view?

975


Explian rowid, rownum?

956


Is sql developer case sensitive?

944


What is the difference between alter trigger and drop trigger statements?

1042


When sql appeared?

1023


What does pragma mean?

972


What is procedure and function?

921