复制代码 代码如下:

# id唯一,num连续序号
# select a.id,num=(select count(1) from tb b where b.id<=a.id ) from tb a

更多文章请关注《万象专栏》