sql query question# Database - 数据库
c*n
1 楼
Table A: 3 attributes (id, qty, date) e.g. row (a001, 50, 200705)
Now want to produce a table B which contains 3 attributes (id, sum1, sum2)
sum1= sum(qty) between 200705 and 200804
sum2 = sum(qty) between 200605 and 200704
Is there any smart method to get table B?
Now want to produce a table B which contains 3 attributes (id, sum1, sum2)
sum1= sum(qty) between 200705 and 200804
sum2 = sum(qty) between 200605 and 200704
Is there any smart method to get table B?