日期:2014-05-17 浏览次数:20522 次
----------------------------
-- Author :DBA_Huangzj(發糞塗牆)
-- Date :2013-08-19 17:15:07
-- Version:
-- Microsoft SQL Server 2014 (CTP1) - 11.0.9120.5 (X64)
-- Jun 10 2013 20:09:10
-- Copyright (c) Microsoft Corporation
-- Enterprise Evaluation Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
--
----------------------------
--> 测试数据:[Sale]
if object_id('[Sale]') is not null drop table [Sale]
go
create table [Sale]([syear] int,[smonth] int,[smoney] int)
insert [Sale]
select 2011,1,10 union all
select 2011,3,20 union all
select 2011,5,10 union all
select 2011,1,50 union all
select 2011,7,10 union all
select 2011,10,80 union all
select 2011,1,10 union all
select 2011,2,10 union all
select 2011,3,20 union all
select 2011,1,10 union all
select 2011,8,100 union all
select 2011,8,10 union all
select 2011,12,10 union all
select 2012,1,10 union all
select 2012,3,20 union all
select 2012,5,10 union all
select 2012,1,50 union all
select 2012,7,10 union all