Re: select & group by
| От | Ragnar Hafstað |
|---|---|
| Тема | Re: select & group by |
| Дата | |
| Msg-id | 1112612355.19933.12.camel@localhost.localdomain обсуждение исходный текст |
| Ответ на | Re: select & group by (Ragnar Hafstað <gnari@simnet.is>) |
| Ответы |
Re: select & group by
|
| Список | pgsql-sql |
On Mon, 2005-04-04 at 10:47 +0000, Ragnar Hafstað wrote: > On Mon, 2005-04-04 at 12:16 +0200, Michael L. Hostbaek wrote: > > [problem] > [slightly broken solution] I forgot a FROM clause, and you might want to add a ORDER BY clause, if that is important: select part,mfg, sum(CASE WHEN eta is NULL then qty ELSE 0 END) as qty, sum(CASE WHEN eta is NULL then 0 ELSE qtyEND) as "qty incoming", max(price) as "highest price", min(eta) as eta from thetable group by part,mfg order by part,mfg; gnari
В списке pgsql-sql по дате отправления: