SQL Server Select MAX
Posted on 2012-08-22
I have a table containing Serial Numbers many of which have multiple Ids:
I need to write a SQL Server query to produce a new table containing just the serial number entries with the highest id's so that, in the above list, only rows with these Id's would be selected: 2, 5, 6 & 8.
I've tried various queries using MAX, GROUP BY & HAVING but I haven't come up with a solution. What's the best way of doing this?