not so sequential sequences

Поиск
Список
Период
Сортировка
От Rhys Stewart
Тема not so sequential sequences
Дата
Msg-id 189966030610171418v30b3fc23haa726f163ecdd409@mail.gmail.com
обсуждение исходный текст
Ответы Re: not so sequential sequences  (Alexander Staubo <alex@purefiction.net>)
Re: not so sequential sequences  (louis gonzales <gonzales@linuxlouis.net>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: query log corrupted-looking entries
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Re: exploiting features of pg to obtain polymorphism