首页 > 数据库技术 > 详细

create auto increment row with select in postgreSQL

时间:2015-04-16 07:55:46      阅读:201      评论:0      收藏:0      [点我收藏+]

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;

 

create auto increment row with select in postgreSQL

原文:http://www.cnblogs.com/phoenix13suns/p/4430912.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!