Re: Counting # of consecutive rows with specified value(s)?

Поиск
Список
Период
Сортировка
От François Beausoleil
Тема Re: Counting # of consecutive rows with specified value(s)?
Дата
Msg-id CF7DA474-660B-4EC4-B7E7-60A0C3BE6ABF@teksol.info
обсуждение исходный текст
Ответ на Counting # of consecutive rows with specified value(s)?  (Ken Tanzer <ken.tanzer@gmail.com>)
Ответы Re: Counting # of consecutive rows with specified value(s)?  (Ken Tanzer <ken.tanzer@gmail.com>)
Список pgsql-general

Le 2012-06-06 à 22:20, Ken Tanzer a écrit :

I can currently test whether someone has at least a specified number of consecutive absences with the query below, but it would be  better to get the actual number.

As a second question, what about getting the number of consecutive records for a set of values?  (e.g., attendance_code IN ('ATTENDED','EXCUSED')

Any ideas or suggestions?  Thanks.

This is similar to the islands and gaps problem. Search for that on StackOverflow and you'll get it.

Bye!
François

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

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Problem with pg_upgrade 8.3 to 9.1.4 - clog missing?!
Следующее
От: Dinsdale
Дата:
Сообщение: Re: Missing row after update