Home > Database > Mysql Tutorial > body text

If I try to add two numbers enclosed in quotes, how does MySQL calculate it?

WBOY
Release: 2023-08-26 10:21:08
forward
1024 people have browsed it

如果我尝试将引号中包含的两个数字相加,MySQL 如何计算?

If we try to add two numbers contained in quotes, it means we are treating the string as a number. In this case, MySQL converts the value to the nearest numeric value and evaluates the result. The following example demonstrates this.

Example

mysql> Select '1525' + '200'As Total;
+-------+
| Total |
+-------+
| 1725  |
+-------+
1 row in set (0.00 sec)
Copy after login

The above is the detailed content of If I try to add two numbers enclosed in quotes, how does MySQL calculate it?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!