日期:2014-05-18 浏览次数:20623 次
select * from tb t where not exists (select 1 from tb where name = t.name and itime > t.itime)
------解决方案--------------------
select name ,max(itime) from tb group by name
------解决方案--------------------
SELECT NAME,itime FROM Table1 AS a WHERE NOT EXISTS(SELECT 1 FROM table1 WHERE NAME=a.NAME AND ID>a.ID)
------解决方案--------------------
只显示两个字段时用2楼方法 group by +max