SQL: Add column with incremental id to SELECT

前端 未结 4 2566
迷失自我
迷失自我 2021-02-19 03:57

I have a simple query like:

SELECT name FROM people;

The people table does not a have unique id column. I want to add to the query r

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-19 04:49

    Check out the row_number() function at https://www.postgresql.org/docs/current/static/functions-window.html

提交回复
热议问题