When you say 'nested queries' are you referring to a correlated subquery? If a correlated subquery is 'too slow', then you may not have the proper indexes in place.
Did you try:
Code:
SELECT *
FROM yourtable T1
WHERE yourdatetimecolumn
= (SELECT MAX(yourdatetimecolumn)
FROM yourtable T2 WHERE T1.UnitColumn = T2.UnitColumn)
This sort of subquery is about as fast as you can get, given appropriate indexes.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com