Is MATH a column in the database containing a free expression that you don't control? It looks like a terrible design.
Without knowing anything about your application and why you want to do such a crazy thing, I would suggest making it at least more obvious and easy to analyze:
ID | PRICE | COEFFICIENT | ACTION 1 | 10.00 | 1.3 | MULTIPLICATION 2 | 20.00 | 2 | ADDITION 3 | 30.00 | 0.35 | MULTIPLICATION
Then you can do some IF/ELSE in the database or directly in the server language, but still describe what your use case is ...
source share