How can I get SQL Server to return the first value (any one, I don't care, it just needs to be fast) it comes across when aggregating?
For example, let's say I have:
and I need to get any one of the ID's for each group. I can do this as follows:
group by group
That does the job, but it seems stupid to me to ask SQL Server to calculate the highest ID when all it really needs to do is to pick the first ID it comes across.
PS - the fields are indexed, so maybe it doesn't really make a difference?