select * from bas_app a where not exists ( select 1 from bas_app where AppName = a.AppName and id > a.id )