Suppose we try to add non-numeric text between numbers in a string, then MySQL will use only the first number of the string to calculate the addition, and Comes with a caveat. The following example will demonstrate this −
mysql> Select '1525 * 2' + '200'As Total; +-------+ | Total | +-------+ | 1725 | +-------+ 1 row in set, 1 warning (0.00 sec)
It is clear from the above query that MySQL only uses the first number (i.e. 1525) to calculate the addition and ignores non- Digital text.
The above is the detailed content of How does MySQL calculate if we write non-numeric text between numbers in a string when adding numbers contained in quotes?. For more information, please follow other related articles on the PHP Chinese website!