sql - How to show row numbers in PostgreSQL query? -
I want to show an overview number for each record received by a PostgreSQL query.
I 8.4 can display this capability in windowing functions.
select row_number () more than (by sequence & lt; region & gt; ), * Foo_tbl by command & lt; Field & gt;
If the command is not necessary, then this answer may also be simplified:
select row_number () over (), * - Notice: a field Not required from Foo_tbl
Comments
Post a Comment