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

Update Sales_summary set sales = s2.sales
From Sales_summary s1,
(
Select Region, max(sales) sales
From sales_data group by Region
)s2
where s1.Region = s2.Region;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the methods used to protect source code of pl/sql.

734


Does truncate release storage space?

769


What is the difference between a query and a report?

680


What is user defined functions?

746


Explain the rollback statement?

769






What is the difference between the sql*loader and import utilities? : aql loader

758


Why we use join in sql?

702


What is a record in a database?

770


Is it possible for a table to have more than one foreign key?

774


Explain the components of sql?

789


what are different types of collation sensitivity? : Sql dba

757


What is the mutating table and constraining table?

738


What is keys and its types?

751


what is a trigger in mysql? : Sql dba

786


What is union and union all keyword in sql?

724