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...

how to Update table Sales_summary with max(sales) data from
table sales_dataTable 1. sales_data table Table 2.
Sales_summary

Region sales Region sales
N 500 N 0
N 800 W 0
N 600
W 899
W 458
W 900

I want the Sales_summary After Update like this
Region Sales
N 800
W 900


Answer Posted / ajitnayak

update sales_sum s set sales =
(select max(sales) from sales_sum s2 where s.REGIN = s2.REGIN group by REGIN );

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the maximum rows in csv?

930


What are hotfixes and patches?

949


What is auto increment in sql?

1129


how to get a list of columns in an existing table? : Sql dba

966


what is the command line end user interface - mysql? : Sql dba

984


what is blob? : Sql dba

1155


Can I join the same table twice?

1054


How do you delete data from a table?

1047


what does the t-sql command ident_incr does? : Transact sql

1082


Can dml statements be used in pl/sql?

1087


What is a temporal data type?

1055


What does data normalization mean?

976


How many tables can you join in sql?

964


what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba

1077


What is trigger in sql and its types?

1068