SELECT TermName,Phone,Lon,Lat,GPSTime
FROM SOSAlarmWHERE exists(
select * from(
select SOSAlarm.TermName,MAX(ID) as ID from SOSAlarm group by SOSAlarm.TermName) x
WHERE SOSAlarm.TermName=x.TermName AND SOSAlarm.ID=x.ID)
SELECT TermName,Phone,Lon,Lat,GPSTime
FROM SOSAlarm