if object_id('[tb]') is not null drop table [tb] go create table [tb]([name] varchar(20),[time] datetime,[money] float) insert [tb] select 'ÕÅÈý', '2009-2-11', 1000.0000 union all select 'ÀîËÄ', '2009-3-11', 3000.0000 union all select 'ÍõÎå', '2009-2-10', 200.0000 union all select 'ÀîËÄ', '2009-3-20', 2000.0000 union all select 'ÕÅÈý', '2009-3-11', 200.0000 union all select 'ÍõÎå', '2009-3-10', 200.0000 go
select a.* from tb a where a.time=(Select Max(b.time) from tb b where a.Name=b.Name)
Ò»¸öºÜÆæ¹ÖµÄÎÊÌâ SQL code select * from Gprs_DataInof --¿ÉÒԲ鵽ËùÓеÄÊý¾Ý select * from Gprs_DataInof where DataTime between 1900-10-16 1:01:00' and '2009-10-20 1:01:00' --Ò»ÌõÊý¾Ý ......