Good day! I need to get sales for all stocks. There are about 70 stocks in the database. At this time I am writing 70 requests)) Can I shorten my request? Below is one example of my requests.
select oa1.dept_id, COUNT(oa1.id) quantity1, sum(oa1.premium) 'sum1' from Table1 oa1 Left Join Table2 od1 On od1.id = oa1.dept_id where oa1.action_ID = 1 group by oa1.dept_id
They are all the same requests, there just ID changes.
ID
changing?oa1.action_ID
? Or what? - BOPOH