• What about operator precedence? If it needs to be calculated from left to right, it would be easy with string operations. Operator precedence will make it little complicated.

    Please provide us DDL, sample data to play with.