select a,b
from (
select a,b,row_number() over(partition by a order by b desc) as roworder
from myTable
) temp
where roworder = 1
http://msdn.microsoft.com/en-us/library/ms186734.aspx
を参照してくださいselect a,b
from (
select a,b,row_number() over(partition by a order by b desc) as roworder
from myTable
) temp
where roworder = 1
http://msdn.microsoft.com/en-us/library/ms186734.aspx
を参照してください