摘要:
准备案例数据:--SQLcode--建表createtable#Temp(datedatetime,Dcountint)insertinto#Tempselect'2010-01-01',10unionallselect'2010-01-25',10unionallselect'2010-01-31',15unionallselect'2010-02-25',30unionallselect'2010-02-28',20unionallselect'2011-01-03',20unionallsel 阅读全文
posted @ 2011-04-15 15:05
cnby
阅读(811)
评论(0)
推荐(0)
摘要:
--1。得到当前月的天数select datepart(dd,dateadd(dd,-1, --2011-04-30 00:00:00.000dateadd(mm,1,cast(cast(year(getdate()) as varchar)+'-' --2011-04-01 00:00:00.000 +cast(month(getdate()) as varchar)+'-01' as datetime) --2011-05-01 00:00:00.000)))--2.应用case划分 等级 select productid,productName,unitP 阅读全文
posted @ 2011-04-15 04:59
cnby
阅读(613)
评论(0)
推荐(0)
浙公网安备 33010602011771号