摘要: SELECT (SELECT COUNT(*) FROM [table] AS t2 WHERE t2.name <= t1.name) AS rowNum, id, nameFROM [table] t1ORDER BY t1.name asc 阅读全文