--1 select t.* from tablea t where changedate = (select max(changedate) from tablea where mathchid = t.mathchid and chipintypeid = t.chipintypeid)--2 select t.* from tablea t where not exists (select 1 from tablea where mathchid = t.mathchid and chipintypeid = t.chipintypeid and changedate > t.changedate)
select t.* from tablea t where not exists (select 1 from tablea where mathchid = t.mathchid and chipintypeid = t.chipintypeid and changedate > t.changedate)
select t.* from tablea t where changedate = (select max(changedate) from tablea where mathchid = t.mathchid and chipintypeid = t.chipintypeid)--2
select t.* from tablea t where not exists (select 1 from tablea where mathchid = t.mathchid and chipintypeid = t.chipintypeid and changedate > t.changedate)
select t.*
from tablea t
where
not exists (select 1 from tablea where mathchid = t.mathchid and chipintypeid = t.chipintypeid and changedate > t.changedate)