Prova così e vedi se i record che ottieni sono quelli desiderati.
codice:select * from tabella as t1 where (select count(*) from tabella as t2 where t1.attr1 = t2.attr1 and t2.id > t1.id) <2
Prova così e vedi se i record che ottieni sono quelli desiderati.
codice:select * from tabella as t1 where (select count(*) from tabella as t2 where t1.attr1 = t2.attr1 and t2.id > t1.id) <2