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


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)

Lakshmi Srinivas
Lakshmi Srinivas

Programmer / Analyst / Technician

Updated on: 20-Jun-2020

38 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements