日期:2014-05-17 浏览次数:20541 次
----------------------------------------------------------------
-- Author :DBA_Huangzj(發糞塗牆)
-- Date :2013-11-19 11:17:44
-- Version:
-- Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)
-- Dec 28 2012 20:23:12
-- Copyright (c) Microsoft Corporation
-- Enterprise Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )
--
----------------------------------------------------------------
--> 测试数据:[huang]
if object_id('[huang]') is not null drop table [huang]
go
create table [huang]([销售编号] int,[销售日期] datetime,[状态] varchar(4))
insert [huang]
select 10001,'2013-01-01 13:11:11','正常' union all
select 10002,'2013-01-01 13:14:14','正常' union all
select 10003,'2013-01-01 14:14:14','作废' union all
select 10004,'2013-01-02 11:14:14','正常' union all
select 10005,'2013-01-02 11:13:14','正常' union all
select 10006,'2013-01-03 11:13:14','正常'
-