Performing simple arithmetic in MySQL statement or in PHP code

后端 未结 5 1570
野性不改
野性不改 2020-12-21 07:47

For instance, say I have a data structure with two integer columns start and end, but I\'m actually interested in the start and difference between

5条回答
  •  不知归路
    2020-12-21 08:42

    MySQL can perform some basic arithmetic. However, it is definitely better to perform that sort of arithmetic in PHP if you're already using the data in PHP anyway.

    MySQL is meant more for simply storing and extracting relational data.

提交回复
热议问题