Re: Ways to deal with large amount of columns;

Поиск
Список
Период
Сортировка
От Robert Zenz
Тема Re: Ways to deal with large amount of columns;
Дата
Msg-id 5B87EDDF.60602@sibvisions.com
обсуждение исходный текст
Ответ на Ways to deal with large amount of columns;  ("a" <372660931@qq.com>)
Ответы Re: Ways to deal with large amount of columns;  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Список pgsql-general
As David said, you'd be better off having a table that looks like this (in terms
of columns):

 * MONTH
 * AGENT
 * CASHFLOW

So your query to get the sum of a single agent would be looking like:

    select
        sum(CHASFLOW)
    where
        AGENT = 'Agent'
        and MONTH between values;

It might be a little more work to create a GUI for that (or map this model to
the existing GUI) but it is much simpler to maintain and work with.


On 30.08.2018 11:13, a wrote:
> Hi all:
> 
> 
> I need to make a table contains projected monthly cashflow for multiple agents (10,000 around).
> 
> 
> Therefore, the column number would be 1000+. 
> 
> 
> I would need to perform simple aggregate function such as count, sum or average on each cashflow projected.
> 
> 
> So if there is anyway of doing this? Will there be anything like define a macro in C that I can manipulate multiple
columnsby simple word that representing them.
 
> 
> 
> Thanks so much!
> 
> 
> Shore
>

В списке pgsql-general по дате отправления:

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Ways to deal with large amount of columns;
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Ways to deal with large amount of columns;