select
*
from
(
SELECT
t.*,ROW_NUMBER() over (partition
by
t.pid
order
by
t.op_time
desc
) num
FROM
[master].[dbo].[Table_1] t
) a
where
num=1
posted on 2016-12-09 11:30 阅读( ...) 评论( ...)