I have a very simple query, but some booking columns repeat and if they do i do not want to show them, however the entire row is not the same how can i make it so if the row is a duplicate show the one with the max total.
SELECT PREMIUMYEAR,
LASTNAME,
FIRSTNAME,
BOOKING,
CLAIMTYPE,
DEPARTUREDATE,
[PLAN],
INCIDENT,
RESERVEAMOUNT,
FINALSTATUS,
AGE,
TOTAL
FROM dbo.[table]
1 Answer