随笔分类 - Sql
摘要:一、需求 需求很简单,就是需要查询一个报表,只有1个表,数据量大约60万左右,但是中间有些逻辑。 先说明一下服务器配置情况:1核CPU、2GB内存、机械硬盘、Sqlserver 2008 R2、Windows Server2008 R2 SP1和阿里云的服务器,简单说就是阿里云最差的服务器。 1、原
阅读全文
摘要:declare @startDay smalldatetime ='2013-01-01' ;with cte as( select @startDay as d union all select DATEADD(d,1,d) as d from cte where d<'2019-05-01')
阅读全文