SUM() OVER (ORDER BY..)

Roberto Cornacchia roberto.cornacchia at gmail.com
Fri Apr 29 09:41:21 CEST 2016


Ignore that, my bad. You can also aggregate over all rows, of course.



On 29 April 2016 at 09:37, Roberto Cornacchia <roberto.cornacchia at gmail.com>
wrote:

> I think what you are looking for is SUM(..) OVER(PARTITION BY ..)
>
> Otherwise where would the groups for the sum come from?
>
> Roberto
>
> On 29 April 2016 at 09:28, Anthony Damico <ajdamico at gmail.com> wrote:
>
>> hi, monetdb does not support SUM() OVER commands..  does anyone have a
>> smart alternative to implement this?  thanks
>>
>>
>>     SELECT
>>         batch_id,
>>         job_count,
>>         SUM(job_count) OVER (ORDER BY duration) as cumjobs,
>>         SUM(job_count) over () as totjobs,
>>         duration
>>     FROM
>>         test_data ;
>>
>>
>> _______________________________________________
>> users-list mailing list
>> users-list at monetdb.org
>> https://www.monetdb.org/mailman/listinfo/users-list
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.monetdb.org/pipermail/users-list/attachments/20160429/f6957711/attachment-0001.html>


More information about the users-list mailing list