Today, when looking at the development of writing sql to generate the data they found the first seven days of the current date when using a recursive method, mainly lies in understanding this idea, I feel more interesting, record it as follows:
1) generating data before the current time of 7 days
2) before generating current date data 12 months