原始表: if exists (select 1 from sysobjects where name='test1') drop table test1 go create table test1 ( id varchar(10), Tm datetime, data varchar(20) ) insert into test1 select '01','2010-01-01 ','10' insert into test1 select '01','2010-01-02 ','20' insert into test1 select '01','2010-01-03 ','30' insert into test1 select '01','2010-01-04 ','10' insert into test1 select '01','2010-01-05 ','50' insert into test1 select '01','2010-02-01 ','20' insert into test1 select '01','2010-02-02 ','10' insert into test1 select '01','2010-02-03 ','10' insert into test1 select '01','2010-02-04 ','10' insert into test1 select '01','2010-02-05 ','80' insert into te