It's not that hard, it's a matter of doing a sub-query as a joined table getting the MAX() for each of the primary items, then rejoining to the primary table.
IE: select a.* from tbl a JOIN (SELECT [name], max(value) as maxvalue from tbl group by name) as b on a.name = b.name and a.value = b.maxvalue.
If you create consumable data/schema as described in the first link in my signature you'll get some testable code instead of just a quick example.
- Craig Farrell
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA