How MySQL evaluates if I try to add two numbers that are contained in quotes?

MySQLMySQLi Database

If we are trying to add two numbers that are contained in quotes, means we are treating the string as a number. In this case, MySQL converts the value into the closet numeric equivalent and evaluates the result. Following example will demonstrate it.

Example

mysql> Select '1525' + '200'As Total;
+-------+
| Total |
+-------+
| 1725  |
+-------+
1 row in set (0.00 sec)
raja
Published on 21-Feb-2018 06:30:23
Advertisements