Re: Creating Report for PieChart
От
Bruce Momjian
Тема
Re: Creating Report for PieChart
Дата
Msg-id
20151014005744.GA7843@momjian.us
Ответ на
Creating Report for PieChart (Alex Magnum)
Список
Дерево обсуждения
Creating Report for PieChart Alex Magnum <magnum11200@gmail.com>
Re: Creating Report for PieChart Bruce Momjian <bruce@momjian.us>
Re: Creating Report for PieChart Scott Mead <scottm@openscg.com>
Re: Creating Report for PieChart Scott Mead <scottm@openscg.com>
Re: Creating Report for PieChart dinesh kumar <dineshkumar02@gmail.com>
On Wed, Oct 14, 2015 at 01:56:11AM +0200, Alex Magnum wrote: > Hello, > I need to process some statistics for a pie chart (json) where I only want to > show a max of 8 slices. If I have more data points like in below table I need > to combine all to a slice called others. If there are less or equal 8 i use > them as is. > > I am currently doing this with a plperl function which works well but was just > wondering out of curiosity if that could be done withing an sql query. > > Anyone having done something similar who could point me in the right direction? I think you want the HAVING clause, e.g. HAVING COUNT(*) > 8. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Roman grave inscription +
В списке pgsql-general по дате отправления