| От | Michael Glaesemann |
|---|---|
| Тема | Re: fetch first rows of grouped data |
| Дата | |
| Msg-id | 56BD71D2-D761-4A80-9B3B-40CD7BF4BE8A@seespotcode.net обсуждение исходный текст |
| Ответ на | Re: fetch first rows of grouped data (Michael Glaesemann <grzm@seespotcode.net>) |
| Список | pgsql-sql |
On Aug 27, 2007, at 13:12 , Michael Glaesemann wrote: > select city, event, event_date, ( > select count(event) > from events i > where i.city = o.city > and i.event_date < o.event_date > and event_date > current_date -- make sure they're future > events This should be i.event_date > current_date to be explicit. > ) as nearness_rank > from events o > where event_date > current_date -- make sure they're future events > having nearness_rank <= 1; Michael Glaesemann grzm seespotcode net
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера