MySql: Store Equations in MySql Database
MySql: Store Equations in MySql Database
I have to store data in the following manner:
The datatype of the value column is not known
id value
1 10+6
2 2+10
3 15+1
I want result in
select values from test;
id value
1 16
2 12
3 16
Thanks in advance :)
This makes no sense. The
value column has an expression which is pretty clearly a string. You should do the calculations before you insert the values.– Gordon Linoff
Jul 2 at 13:56
value
There is an answer here that may help: stackoverflow.com/questions/16355972/…
– Arthur Hylton
Jul 2 at 14:10
What does this have to do with database design?
– Brian
Jul 2 at 15:25
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
One thing is to store an equation (can be a simple varchar), and another one is to evaluate it. Do you want to store the equation or its resulting value?
– The Impaler
Jul 2 at 13:50