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
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