Home > database >  For SQL
For SQL

Time:02-28

The 2021-02-23 data
10 years, the half a year time,

Generate date
In the 2021-08-23 s,
In the 2022-02-23 s,
In the 2022-08-23 s,
In the 2023-02-23 s,
. ...
The 2031-02-23

The SQL generated date, should be how to write

CodePudding user response:

 
The SELECT DATEADD (MONTH, number * 6, '2021-02-23') FROM the master. The dbo. Spt_values WHERE type='P' AND number BETWEEN 1 AND 20
The ORDER BY number
  • Related