2014/02/11 18:14 -0500, Larry Martell
set LIMIT = sign(LIMIT) * 100 * floor(0.01 + (sign(LIMIT) * LIMIT
* ratio/100)
The function TRUNCATE can be useful here:
set LIMIT = TRUNCATE(LIMIT * ratio + 0.01 * sign(LIMIT), -2)
, if it works as advertized. In any case,
ABS(LIMIT) = sign(LIMIT)
On Wed, Feb 12, 2014 at 5:35 PM, h...@tbbs.net wrote:
2014/02/11 18:14 -0500, Larry Martell
set LIMIT = sign(LIMIT) * 100 * floor(0.01 + (sign(LIMIT) * LIMIT
* ratio/100)
The function TRUNCATE can be useful here:
set LIMIT = TRUNCATE(LIMIT * ratio + 0.01 * sign(LIMIT), -2)
, if
Is there some way I can have a conditional in an update?
I have this update sql (paraphrased):
update LMPROC_LIMITS
set LIMIT = sign(LIMIT) * 100 * floor(0.01 + (sign(LIMIT) * LIMIT
* ratio/100)
where SYMBOL_ID = symbolId
and CLASSTYPE = LimitType
and TYPE_ in ('minClusterPosition