HI:
You can use windows functions. https://www.postgresql.org/
docs/9.5/static/tutorial-window.html
specifically row_number(). https://www.postgresql.org/
docs/9.5/static/tutorial-window.html
I'm assuming that your ordering is based on lname and then fname.
The query for getting 'number' is
san
> On 25 Oct 2016, at 17:06, Mark Lybarger wrote:
>
> I want to update a table to have the value of the occurrence number. For
> instance, I have the below table. I want to update the number column to
> increment the count of last name occurrences, so that it looks like this:
>
> first last
I want to update a table to have the value of the occurrence number. For
instance, I have the below table. I want to update the number column to
increment the count of last name occurrences, so that it looks like this:
first last 1
second last 2
third last 3
first other 1
next other 2
Here's my