版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/y1535623813/article/details/88072045
with p_x as (
select [id]
,[name]
,[classid]
,[orderid], ROW_NUMBER() OVER(Partition by classid order by orderid) as rowid FROM table
)
select * from p_x
with p_x as (
select [id]
,[name]
,[classid]
,[orderid], ROW_NUMBER() OVER( order by orderid) as rowid FROM table
)
select * from p_x