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
What is the difference between partitioning and sharding?
Are stored procedures compiled?
How do I tune a sql query?
Explain the the update statement in sql?
How many types of tables are there?
What is an intersect?
What is using in sql?
Can we insert data in view?
how to use like conditions? : Sql dba
What are the different types of a subquery?
What is the sql query to display the current date?
What is pl sql architecture?
What is replication id?
Which tcp/ip port does sql server run?
What is a database? Explain