Home  >  Article  >  Database  >  How to convert string to int type in mysql

How to convert string to int type in mysql

王林
王林Original
2020-09-27 14:04:1322304browse

How to convert a string to int type in mysql: You can use the Convert() method to convert, such as [SELECT CONVERT("2017-08-29", DATE);].

How to convert string to int type in mysql

#You can use the Convert (field name, type) method to perform conversion.

(Recommended tutorial: mysql video tutorial)

Grammar format:

SELECT CONVERT(filedName, UNSIGNED INTEGER) ;

Example:

SELECT CONVERT("2017-08-29", DATE);

Commonly used conversion types

How to convert string to int type in mysql

Related recommendations: php training

The above is the detailed content of How to convert string to int type in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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