一种方法是
count在子查询中使用该函数。不确定它的伸缩性是否合适,可能还有更好的方法…
select (select count(*) from city where ID_city <= t1.ID_city) as row_number, *from city t1

一种方法是
count在子查询中使用该函数。不确定它的伸缩性是否合适,可能还有更好的方法…
select (select count(*) from city where ID_city <= t1.ID_city) as row_number, *from city t1