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

How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

762


Sql technical questions

859


What is difference between table and view?

612


how can we destroy the session, how can we unset the variable of a session? : Sql dba

636


What is a natural join sql?

598






What is compound trigger?

666


what is self join and what is the requirement of self join? : Sql dba

762


What is difference between rank () row_number () and dense_rank () in sql?

680


What does an inner join do?

666


what are the features and advantages of object-oriented programming? : Sql dba

625


What is the need of merge statement?

664


What are the different parts of a package?

717


Is sql easier than java?

627


Show the cursor attributes of pl/sql.

698


Explain select statements in sql?

681