You could write a Stored Procedure or Function to do this, or try something
like this:
Do you want the sum of the product of each of the pair of 2 values from the
set?
Select sum(val1 * val2) from <table>
Where <clause>
Tom Flaherty
-----Original Message-----
From: Olsen Richard N.
[mailto:db2udbdba-ezmlmshield-x45370778.[Email address protected]
Sent: Monday, March 31, 2008 4:17 PM
To: LazyDBA Discussion
Subject: Multiplication
There is a function SUM, which will add a column and give you a total.
Is there a similar function for multiplication?
For a query, I need to select (multiple sets based on specific criteria)
two values, multiply them to receive an amount, then sum the values to
see if the total exceeds a specified amount.
I'm just wondering if there is an easier way then setting up multiple
select statements .... Any advice you can offer would be appreciated.
Thank you,
Richard N. Olsen
Database Administrator
SC Department of Disabilities & Special Needs
Phone: (803) 898-9811
Email: [Email address protected]
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page