I have 4 columns called ID, EQUIPID, VERSION, DESCRIPTION. Users can add additional columns so the SQL statement needs to be dynamic. The column ID is unique and will never duplicate; EQUIPID describes an equipment which means multiple EQUIPIDs can be the same; and VERSION describes the difference between the same EQUIPID entries.
How can i query to SELECT * and get only one of each EQUIPID with largest VERSION?
Basically, select rows where the version is equal to the max version for that equipid.