select * from tb a
where not exists(
select 1 from tb
where catalogid=a.catalogid and showid=a.showid
and( version>a.version or version=a.version and id>a.id))
select * from table1 t
where not exists(select 1
from table1
where catalogid=t.catalogid
and showid=t.showid
and version>t.version)
或者
select id=(select top 1 id from table1 b where b.version=a.version ),catalogid ,showid , max(version) from table1 a group by catalogid , showid