I\'m looking get two things from a query, given a set of contraints:
I can get the first ma
Try next query:
select top 1 *, count(*) over () rowsCount from ( select *, dense_rank() over (order by ValueForOrder) n from myTable ) t where n = 1