Yep SQL Server has much less ranking functions (SQL Server term :) than Oracle has analytic functions (Oracle term :). At least I dont know how to do that without subquery, but probably row_number() instead of rank() would be better, because with rank() you can get more than one row with rank = 1. Speaking about nulls last/first one can use either case construction in order by clause or isnumeric(order_col) or probably some other technique. Not so elegant but it works. Gints Plivna http://www.gplivna.eu 2011/5/25 Sweetser, Joe <JSweetser@xxxxxxxx>: > ….for SQL server 2005. -- //www.freelists.org/webpage/oracle-l