| От | Vortex |
|---|---|
| Тема | Re: select within aggregate? |
| Дата | |
| Msg-id | 20050506104030.3e725437.vortex25@gmx.de обсуждение |
| Ответ на | select within aggregate? (Vortex <vortex25@gmx.de>) |
| Список | pgsql-sql |
On Fri, 6 May 2005 13:34:26 +0530 "Ramakrishnan Muralidharan" <ramakrishnanm@pervasive-postgres.com> wrote: > SELECT abc.remote_host , c , abc.request_uri , a.t FROM abc , ( select remote_host , count(*) as c , max( ts ) as t fromabc group by remote_host ) as a > where a.remote_host = abc.remote_host and abc.ts = a.t I thought about this too. But what happens if there are accidentally two sets with same timestamp in the table? I suppose the outer select would match both of them. But a DISTINCT should help to avoid this. Ok, if you think this is the propper way to meet the requirement i will do so. Thank you for your answer! Klaus
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера