| От | Richard Broersma Jr |
|---|---|
| Тема | Re: How to get single raws for sums in a summary table? |
| Дата | |
| Msg-id | 358606.46780.qm@web31807.mail.mud.yahoo.com обсуждение |
| Ответ на | Re: How to get single raws for sums in a summary table? (Ennio-Sr <nasr.laili@tin.it>) |
| Ответы |
Re: How to get single raws for sums in a summary table?
|
| Список | pgsql-novice |
> ----------------------------------- > > PS: I didn't go through all pg-documentation so my guess might be a bit > of hazard: shouldn't the 'distinct on (some_field)' do all the job on its own > with no need for the second (sub)select? Otherwise there seems to be no > difference between 'select distinct on (fx) f1, f2, .,fx,. ,fn' and > 'select distinct f1, f2, .,fx,. fn'. > I think that distinct on works like a where clause. So if filter out records rather than grouping them. So you end up with a sum of 1 record. Regards, Richard Broersma jr.
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера