求一SQL語句 请用SQL语句取得数据库服务器当前日期的前30天的日期. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select convert(varchar(30),getdate()-30,120) --请用SQL语句取得数据库服务器当前日期的前30天的日期.select convert(varchar(30),getdate()-30,120) select covert(varchar(50),getdate()-30,120) select convert(varchar(10),dateadd(d,-number,getdate()),120)dt from master..spt_values where type='p' and number<30/*dt----------2011-10-102011-10-092011-10-082011-10-072011-10-062011-10-052011-10-042011-10-032011-10-022011-10-012011-09-302011-09-292011-09-282011-09-272011-09-262011-09-252011-09-242011-09-232011-09-222011-09-212011-09-202011-09-192011-09-182011-09-172011-09-162011-09-152011-09-142011-09-132011-09-122011-09-11(30 行受影响)*/ select convert(varchar(30),getdate()-30,120) 如何实现数据表中记录的合并? 请教一个权限问题 看看这个语句有什么错误!~为什么oracle不能运行?(急) 关于判断的问题 行列交叉的問題 请问下。。sql怎么判断一个个月的第一周,第二周,第三周 如何查询数据库中时间大于指定某个天数的记录 查询 有谁知道SQL7.0中关于MAIL部分? 请问,如何用SQL语句更改SQL SERVER的安全模式呢? 从NT认证模式更改到混合模式。 求助 discuz数据库如何导入旧的数据
--请用SQL语句取得数据库服务器当前日期的前30天的日期.
select convert(varchar(30),getdate()-30,120)
/*
dt
----------
2011-10-10
2011-10-09
2011-10-08
2011-10-07
2011-10-06
2011-10-05
2011-10-04
2011-10-03
2011-10-02
2011-10-01
2011-09-30
2011-09-29
2011-09-28
2011-09-27
2011-09-26
2011-09-25
2011-09-24
2011-09-23
2011-09-22
2011-09-21
2011-09-20
2011-09-19
2011-09-18
2011-09-17
2011-09-16
2011-09-15
2011-09-14
2011-09-13
2011-09-12
2011-09-11(30 行受影响)*/