第一:
select ROW_NUMBER() OVER (ORDER BY a.字段 ASC) AS XUHAO,a.* from table a
(table 为表名,字段为表a中的字段名)
第二:
select RANK() OVER (ORDER BY a.字段 ASC) AS XUHAO,a.* from table a
Powered by: 博客园 Copyright © 2024 Trible.H Powered by .NET 9.0 on Kubernetes