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 sql*plus environment variables?

772


What do you mean by “trigger” in sql?

799


State some properties of relational databases?

762


Define the select into statement.

778


Can we delete column in sql?

769






What is clustered index sql?

700


What are the different types of constraints?

742


Give the order of sql select?

832


What is benefit of creating memory optimized table?

703


Why we use stored procedure instead of query?

710


what are all the common sql function? : Sql dba

779


Why procedure is used in sql?

754


What has stored procedures in sql?

783


what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba

751


how to delete an existing column in a table? : Sql dba

716