2011-04-08 58 views

回答

7
select max(id) id, name 
from tbl 
group by name 
having count(*) > 1 

select tbl.* 
from tbl 
left join (
    select max(id) id 
    from tbl 
    group by name 
    having count(*) > 1) x on x.id = tbl.id 
where x.id is null 
+0

+1。我做了一次無用的旅行。 :) – 2011-04-08 10:27:50

相關問題