On 10/10/08, Garrett Fitzgerald <[EMAIL PROTECTED]> wrote: >I was wondering if anyone had any thoughts on how > to do it more efficiently. I don't like those correlated subqueries > just to get a max and a min, but I don't know that there's a better > way.
If you were just after a MAX() or a MIN() you wouldn't have to use the subqueries, but that's not what you are doing. You're getting the MAX() and MIN()s and then also getting a non-aggregated value from those same records. While the code is a bit difficult to read, I've seen much worse, and I suspect you can't get the result you're after without writing something at least this difficult. -- Ted Roche Ted Roche & Associates, LLC http://www.tedroche.com _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

