Home > database >  O month sales peak time, bother everybody the teacher help realize, thank you!
O month sales peak time, bother everybody the teacher help realize, thank you!

Time:09-24

Database has such a data table, field names have product code, date of sales, products generate and vendors, there are a number of products in the product code 1 - n, sales (date) (month) (year) from 2010101 to 20180207 so far (millions of), still can add follow-up, but each product in every month sales date would not necessarily be continuous, sometimes disconnected,
Now ask vendors belonging to any of a month, as a product, n consecutive days a distributor value is the sum of (n is less than 7, and n days must be in the same month, across the month statistics inside), divided by the sellers a and b of the total sales this month, more than 5%, and those products that meet the requirements and time (time to display) in the maximum time for n days such as similar to the select * from table1 the where the sum (n days a products generate, n<7)/sum (the month products generate) & gt; 5%;
Where is actually want to see which months which products products generate more
a few daysSuch as below data,
1 products in March, march, a product of continuous line 7 big seller a, divided by the product distributors in March the sum of a and b, is greater than 5%;
3 products conform to the requirements of the also in September, but these data to find out how language sentence, but it seems too difficult to me

  • Related