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 / keerthi

update Sales_summary
set Sales=(select max(Sales)from Sales_data where
Region=&region) where Region=&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 is user defined functions?

746


What packages(if any) has oracle provided for use by developers?

5323


What is sqlservr exe?

699


What is out parameter used for eventhough return statement can also be used in pl/sql?

800


Can a table have no primary key?

774






How to run pl/sql statements in sql*plus?

760


what is the difference between rownum pseudo column and row_number() function? : Sql dba

810


What is indexing in sql and its types?

740


How many tables can a sql database have?

710


Are subqueries faster than joins?

726


What are the possible values that can be stored in a boolean data field?

719


Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?

790


What are the different types of a subquery?

715


Why do we use joins?

777


How to disable a trigger name update_salary?

896