Re: user defined column functions?

From: Nis Jorgensen <nis_at_dkik.dk>
Date: Thu, 25 Apr 2002 11:08:23 +0200
Message-ID: <n0hfcukqe58324a8mrbip0prchjdame2un_at_4ax.com>


On Wed, 24 Apr 2002 12:12:18 -0700, "Joe \"Nuke Me Xemu\" Foster" <joe_at_bftsi0.UUCP> wrote:

>
>> SELECT CASE MIN (SIGN(nbr))
>> WHEN 1 THEN EXP(SUM(LN(nbr))) -- all positive numbers
>> WHEN 0 THEN 0.00 -- some zeroes
>> WHEN -1 -- some negative numbers
>> THEN (EXP(SUM(LN(ABS(nbr))))
>> * (CASE WHEN
>> MOD (SUM(ABS(SIGN(nbr)-1)/ 2)), 2) = 1
>> THEN -1.00 ELSE 1.00 END)
>> ELSE NULL END AS big_pi
>> FROM NumberTable;
>
>Couldn't MIN(SIGN(nbr)) be -1 even if one or more zeroes is present?

Yes. Probably a case of the poster posting an answer he found in some book, without checking the correctness of it.

-- 
Nis Jorgensen
Amsterdam

Please include only relevant quotes, and reply below the quoted text. Thanks
Received on Thu Apr 25 2002 - 11:08:23 CEST

Original text of this message