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
How to find 3rd highest salary of an employee from the employee table in sql?
How many commands are in sql?
Is a foreign key always unique?
explain the difference between delete , truncate and drop commands? : Sql dba
What is varchar sql?
How many functions are there in sql?
What is the use of prepared statement?
how to drop an existing index in mysql? : Sql dba
What is the starting oracle error number?
Does truncate free space?
What is sql exception?
What does the file extension accdb stand for?
What is the example of procedure?
what is rdbms? : Sql dba
What is delimiter in pl sql?