Search Postgresql Archives

not so sequential sequences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all, looking for a method to number a table sequentially, but the
sequence only increments if the value in a certain column is
different. as in


seq    |   parish
------------------------
1      | Kingston
1      | Kingston
1      | Kingston
1      | Kingston
2      | Lucea
3      | Morant Bay
3      | Morant Bay
3      | Morant Bay
4      | Port Antonio
5      | Savannah-La-Mar
5      | Savannah-La-Mar
5      | Savannah-La-Mar

so i guess i would order by a certain column and then the 'magic
sequence' would be a column that only increments when the column
changes.

Rhys


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux