-- MySQL
使用变量实现,其中T1是任意表
SELECT @rownum :=@rownum+1 AS rownum,t.dt
FROM (
SELECT @rownum:=0,dt FROM T1) t
-- Oracle
select level
from dual
connect by level<10;
MSSQL
SELECT top 10 row_number() OVER (ORDER BY name ASC) AS level
FROM sysobjects