div_noerror() might be another easy workaround

https://stackoverflow.com/questions/30390920/how-to-pass-a-system-function-to-monetdb-through-r/30390939#30390939

On Fri, Jun 19, 2015 at 12:49 AM, Robin Cijvat <robin.cijvat@monetdbsolutions.com> wrote:
Probably not, but a simple workaround would be to calculate your aggregations in a subquery, something like this:

SELECT count / nr / 60
FROM (
   SELECT  count(*) AS count, (max("end")-min(start) AS nr
   FROM table
   GROUP BY s
   HAVING nr <> 0
);

Cheers,
Robin




On 19-06-15 03:00, Raffael Marty wrote:
I might be doing something wrong, but should this really throw a division by zero?

SELECT
     count(*) / ((max("end")-min(start)) / 60)
FROM    table
GROUP BY s
HAVING max("end")-min(start)<>0 ;

Strangely enough, this works:

SELECT
     count(*) / ((max("end")-min(start)))
FROM    table
GROUP BY s
HAVING max("end")-min(start)<>0;

Am I doing something wrong?

Thanks

   Raffael



  Visual Analytics Workshop at #BlackHat US in August:   http://bit.ly/1FN1W5e
  Raffael Marty
  ceo @ pixlcloud                                        http://pixlcloud.com
  @raffaelmarty                                          http://raffy.ch
_______________________________________________
users-list mailing list
users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list

_______________________________________________
users-list mailing list
users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list