Link to home
Start Free TrialLog in
Avatar of Ed
EdFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Find Max unique ID SQL

I have a table where In need to find the last transaction of a unique ID
Eg

SalesID     TransID      Name  
   85              197            xxxx
   85               199            xxxx
    85              285            xxxxxxxxxx
    85               167            xxxx
   106               298            xxxx
   106               402        xxxxxxxxxx
   106               588         xxxx


so the above I would want to return the max unique ID(TransID)  -  in the above case the highest TransID of each unique SalesID


Resuts Id wanted returned from the above.

SalesID     TransID      Name  
 85              285            xxxxxxxxxx
106               588         xxxx


   
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ed

ASKER

Perfect, Thanks