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 / vipul garg

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

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are field types?

626


what are the different index configurations a table can have? : Sql dba

653


How can you load multi line records? : aql loader

723


What is a table in a database?

665


How does a trigger work?

625






how to create a new table by selecting rows from another table in mysql? : Sql dba

645


what are tables and fields? : Sql dba

657


What are the dml statements?

771


when is the use of update_statistics command? : Sql dba

592


what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba

752


Can we insert data in view?

592


What does pl sql developer do?

599


What is %rowtype in pl sql?

604


Can I create table without primary key?

637


What is union and union all keyword in sql?

644