欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

连续序号的 sql语句

程序员文章站 2022-05-17 08:49:07
复制代码 代码如下:# id唯一,num连续序号 # select a.id,num=(select count(1) from tb b where b.id<=a...
复制代码 代码如下:

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