我想知道是否有可能枚举回来。不是根据任何列的内容,而是产生连续的整数索引。 % N& _; J' c- u+ O3 u s+ Cselect ?,count(*) as usercount from users group by age返回一些内容:( g/ ^# H+ m2 H' v( f3 q- ^# E
122 122 783 444 422 4222 它用于https://data.stackexchange.com/' }2 i: A1 {2 L' C6 J7 W6 `
: B% c) g: N. x+ V; `8 \解决方案: ) |& B' z( y7 c5 k
尝试: . W/ P% E. Y5 L$ E# W2 n- NSELECT ROW_NUMBER() OVER(ORDER BY age) AS RowNumber count(*) as usercount from users group by age