phoenix13

导航

 

http://stackoverflow.com/questions/3959692/rownum-in-postgresql

SELECT 
    row_number() OVER (ORDER BY col1) AS i, 
    e.col1, 
    e.col2, 
    ... 
FROM ...

OR

select row_number() over() as id, t.*
from information_schema.tables t;

 

posted on 2015-04-16 06:55  phoenix13  阅读(187)  评论(0编辑  收藏  举报