Home > Database > Mysql Tutorial > body text

When adding numbers enclosed in quotes, how does MySQL calculate if we write non-numeric text after the number?

王林
Release: 2023-09-18 16:49:17
forward
949 people have browsed it

在添加引号中包含的数字时,如果我们在数字后面写入非数字文本,MySQL 如何计算?

Suppose if we try to add a number followed by non-numeric text, then MySQL will simply discard the non-numeric text and evaluate the addition of the numeric value with a warning. The following example will demonstrate this -

Example

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

The above is the detailed content of When adding numbers enclosed in quotes, how does MySQL calculate if we write non-numeric text after the number?. 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!