日期:2014-05-16 浏览次数:20705 次
----------------------------------------------------------------
-- Author :DBA_HuangZJ(发粪涂墙)
-- Date :2014-04-04 13:38:24
-- Version:
-- Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64)
-- Apr 2 2010 15:48:46
-- Copyright (c) Microsoft Corporation
-- Enterprise 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]([id] int,[a] nvarchar(38),[b] int)
insert [huang]
select 0,'3M00059-2028A-1.24C',2 union all
select 1,'3M00059-2028A-1.24C',2 union all
select 2,'3M00059-2028A-1.24A',3 union all
select 3,'3M00059-2028A-1.25B',3 union all
select 4,'3M00059-2028A-1.25C',4 union all
select 5,'3M00062-2028A-1.25C',1 union all
select 6,'3M00063-2030A-1.25C',1 union all
select 7,'3M00063-2030A-1.26B',1 union all
select 8,'3M00065-2028A-1.26C',2 union all
select 9,'3M00065-2028A-1.27A',1 union all
select 10,'3M00065-2028A-1.27B',1 union all
select 11,'3M00068-2028A-1.28A',1 union all
select