Home > database >  Please help to look at, how do you write the SQL is better, the amount of data statistic?
Please help to look at, how do you write the SQL is better, the amount of data statistic?

Time:11-07

A data table send with each channel (media_id) according to the time span of the corresponding trade request (send_id) and after the specific transaction (cost_id), time (date) from 20200101 until 20200831,
Corresponding to statistics a detailed transaction effectively, condition is:
1, when one channel of t + 1 trade request to 0 when amount (0);
2, t and t - 6 to a trade request number average (t - six to t every day of the seven days of the request is not 0), is t - 7 it five times a day,
According to these two conditions, calculation every month all channels to t t - 1 the trading amount of the SQL how to write? As shown in figure:

CodePudding user response:

bumps

CodePudding user response:

There are big? ! Genuflect is begged
  • Related