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 / preeti mishra

update T
set A:=A+B,
B:=A-B,
A:=A-B;

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are triggers in sql?

974


How do you get column names only for a table (sql server)?

1102


What is the use of procedures?

926


Explain the difference between triggers and constraints?

921


What is memory optimized table?

986


What are the advantages of normalization?

1040


How many sectors are in a partition?

1033


How do you write a subquery?

968


Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?

987


Why do we need unique key in a table?

886


How do you optimize a query?

941


What is an invalid partition table?

962


How do you create a unique index?

992


What is a unique key and primary key and foreign key?

920


How is indexing done in search engines?

930