Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

"Product" aggregation function

2 posts in General Discussion (old) Last posting was on 2007-10-23 18:03:08.0Z
"Frank Ploessel" <fpl... Posted on 2007-10-23 17:39:54.0Z
Subject: "Product" aggregation function
From: "Frank Ploessel" <fpl...@d_e.i_m_s_h_e_a_l_t_h.c_o_m>
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Newsgroups: sybase.public.sqlanywhere
Content-Transfer-Encoding: 7bit
Message-ID: <op.t0nvcrwdj0bybf@bonw00164.internal.imsglobal.com>
User-Agent: Opera Mail/9.21 (Win32)
NNTP-Posting-Host: mail.taskarena-software-engineering.net
X-Original-NNTP-Posting-Host: mail.taskarena-software-engineering.net
Date: 23 Oct 2007 10:39:54 -0700
X-Trace: forums-1-dub 1193161194 217.76.101.130 (23 Oct 2007 10:39:54 -0700)
X-Original-Trace: 23 Oct 2007 10:39:54 -0700, mail.taskarena-software-engineering.net
Lines: 20
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:44
Article PK: 866499

Hi,

When I discussed a case this morning where we need a kind of least common
multiple of some values, I came to realize that nearly no relational dbms
has a "product" aggregation function while all have "sum" available.

In our case, this was not a real issue, as we are assuming a value from
between 3 and 10 records to be multiplied, and doing the multiplication in
a cursor in a stored function does not need a lot of code, and is not
performance critical as well.

But to me it appears strange there does not seem to be more business
requirement for this. DOes averybody just sum numbers, and never multiply?
And obviously there is a bit more potential for overflow when multiplying
huge data sets than when summing them.
Maybe these are the reasons why nobody implements this?

What do you think?

Frank


anil k goel Posted on 2007-10-23 18:03:08.0Z
From: "anil k goel" <anilgoel@nowhere.com>
Newsgroups: sybase.public.sqlanywhere
References: <op.t0nvcrwdj0bybf@bonw00164.internal.imsglobal.com>
Subject: Re: "Product" aggregation function
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: iarouter.sybase.com
X-Original-NNTP-Posting-Host: iarouter.sybase.com
Message-ID: <471e375c$1@forums-1-dub>
Date: 23 Oct 2007 11:03:08 -0700
X-Trace: forums-1-dub 1193162588 10.25.106.45 (23 Oct 2007 11:03:08 -0700)
X-Original-Trace: 23 Oct 2007 11:03:08 -0700, iarouter.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:45
Article PK: 866500

I don't have answers offhand to your questions below, Frank, but you can
simulate the product() aggregate in SA using something like the following:

SELECT POWER(10, SUM(LOG10(c1)))
FROM t1

The work around above has been discussed in many other articles available on
the net...

I don't believe we have had many, if any, customer requests in the past for
adding a native product() aggregate.

-anil
--
Query Processing, SQL Anywhere R&D

"Frank Ploessel" <fpl...@d_e.i_m_s_h_e_a_l_t_h.c_o_m> wrote in message
news:op.t0nvcrwdj0bybf@bonw00164.internal.imsglobal.com...
> Hi,
>
> When I discussed a case this morning where we need a kind of least common
> multiple of some values, I came to realize that nearly no relational dbms
> has a "product" aggregation function while all have "sum" available.
>
> In our case, this was not a real issue, as we are assuming a value from
> between 3 and 10 records to be multiplied, and doing the multiplication in
> a cursor in a stored function does not need a lot of code, and is not
> performance critical as well.
>
> But to me it appears strange there does not seem to be more business
> requirement for this. DOes averybody just sum numbers, and never multiply?
> And obviously there is a bit more potential for overflow when multiplying
> huge data sets than when summing them.
> Maybe these are the reasons why nobody implements this?
>
> What do you think?
>
> Frank