如何在SQL中创建100年的日历表假设我想将数千天存储在一个表中,我将如何从日历中检索它?
3 回答
SMILET
TA贡献1796条经验 获得超4个赞
select top 100000 identity (int ,1,1) as Sequence into Tally from sysobjects , sys.all_columnsselect dateadd(dd,sequence,-1) Dates into CalenderTable from tallydelete from CalenderTable where dates < -- mention the mindate you needdelete from CalenderTable where dates > -- mention the max date you need
添加回答
举报
0/150
提交
取消