SQLServer can't do "select * from (select * from mytable)"? if it can, you just need something to replace the ROWNUM meta-column.
a quick google found me this: "How to dynamically number rows in a SELECT Statement" http://support.microsoft.com/default.aspx?scid=KB;EN-US;q186133 which even contains an example like this: select rank=count(*), s1.stor_id, qty=sum(s1.qty) from (select stor_id, qty=sum(qty) from sales group by stor_id) s1, (select stor_id, qty=sum(qty) from sales group by stor_id) s2 where s1.qty >= s2.qty group by s1.stor_id order by 1 so it looks like it can do the "select from select" thing. It's been a long time (like 6 years) since i've worked with SQLServer. /t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217059 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

