pleeease help!
I need the highest kilometers value and all other related columns from each distinct VehicleId where SalesAgreementID is 10062 from the table below.
The result should look something like this:
SalesAgreementDetailId | SalesAgreementId | VehicleType | VehicleId | Kilometers | Price
166 | 10062 | 123 | 000051 | 17377 | 28500.00
169 | 10062 | 123 | 990140 | 24924 | 28500.00
Tried using:
SELECT DISTINCT VehicleId FROM tblSaleAgreementDetail WHERE SaleAgreementID = '10062';
But it didn't return all the other columns I need including the highest kms.
VehicleId |
000051 |
990140 |
Thaaaankuuu!