日期:2014-05-17 浏览次数:20886 次
select ID,NAME,SCOPE FROM (NAME,SCOPE) IN (SELECT NAME,MAX(SCOPE) FROM TAB GROUP BY NAME )
------解决方案--------------------
select * from tab a
where not exists(select 1 from tab b where a.name=b.name and a.scope<b.scope)
------解决方案--------------------
SELECT ID, NAME, SCOPE FROM TAB WHERE (NAME, SCOPE) IN SELECT NAME, MAX(SCOPE) FROM TAB GROUP BY NAME
------解决方案--------------------