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
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
Can a primary key be a foreign key?
Explain the difference between rename and alias?
What does pl sql developer do?
What are triggers and its types?
How can I see all tables in sql?
what is 'mysqlshow'? : Sql dba
The in operator may be used if you know the exact value you want to return for at least one of the columns.
how do you know the version of your mysql server? : Sql dba
What are inbuilt functions in sql?
How do you copy a table in sql?
Difference between table function and pipelined function?
What is row_number () in sql?
What is the function that is used to transfer a pl/sql table log to a database table?
Are pl sql variables case sensitive?