declare @sdate datetime
declare @edate datetime
set @sdate = '2012-01-01'
set @edate = '2012-01-31'
select
日期 = dateadd(dd,num,@sdate)
from
(select isnull((select count(1) from sysobjects where id<t.id),0) as num from sysobjects t) a
where
dateadd(dd,num,@sdate)<=@edate
order by 日期
追问这段代码不能在my SQL窗口中运行,提示从第一行就错了,另外系统提示 sysobjects 找不到,我了解my sql较少,不知道是那个表,请高手告知一下
谢了
追答sysobjects是记录数据库中所有表的信息
本回答被网友采纳