日期:2014-05-17 浏览次数:20642 次
----------------------------
-- Author :DBA_Huangzj(發糞塗牆)
-- Date :2013-08-14 11:50:32
-- 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)
--
----------------------------
--> 测试数据:[huang]
if object_id('[huang]') is not null drop table [huang]
go
create table [huang]([vender_id] varchar(5),[vender_name] varchar(4),[ITEM] varchar(6),[cx_from_date] datetime,[cx_to_date] datetime,[price] numeric(2,1))
insert [huang]
select 'WH001','微软','55-001','2013/1/1','2013/3/30',0.5 union all
select 'WH001','微软','55-001','2013/4/1','2013/5/31',0.6 union all
select 'WH001','微软','55-001','2013/6/1','2013/10/31',0.5 union all
select 'WH002','IBM','55-002','2013/1/1','2013/3/30',1 union all
select 'WH002','IBM','55-002','2013/4/1','2013/6/30',1.1 union all
select 'WH002','IBM','55-002','2013/7/1','2013/10/31',1.2 union all