解决Oracle迁移至GreenPlum(PostgreSql)后不支持rownum的问题
只需在查询结果中添加一列 row_number() over() as rownum即可
如:
select row_number() over() as rownum , * from table1
但是如果要对rownum进行筛选,那么需要嵌套一层:
select * from (select row_number() over() as rownum , * from table1 ) t where t.rownum = 1