Oralce syntax
July 31st, 2009 |
|
0 Comments »
Question:
Can you explain to me what the belwo query is tryingot do ? is it trying ot grab only the numeric value?
where LENGTH(TRIM(TRANSLATE(tr.result_value, ‘ +-.0123456789′, ‘ ‘))) is null
Solution:
the really correct syntax should be
where LENGTH(TRIM(TRANSLATE(tr.result_value, ‘ +-.0123456789′, ‘ ‘))) = 0
and it would test, if there is no other symbol in the field result_value than space, plus, minus, dot and digits (0-9)
in short, this makes a first test if the field could be considered numerical data, or at least a maths expression.













Comments (0)
Trackbacks - Pingbacks (0)
Leave a Reply