PostgreSQL | Using ROWNUM with row_number()

This shows how to use the equivalent of Oracle’s ROWNUM in PostgreSQL.

SELECT (row_number() over()) AS rownum
     , id
     , title
  FROM board
rownum id title
1 10 title11
2 21 title22
3 20 title44
4 30 title55
5 13 title66