Home > Database > Mysql Tutorial > mysql-MySQL varchar与数字比较 进行查询的问题

mysql-MySQL varchar与数字比较 进行查询的问题

WBOY
Release: 2016-06-06 09:32:50
Original
1336 people have browsed it

mysqlsql

今天写sql的时候遇到一个问题,我在where语句里面写的是a.poruid = 0,这个字段是varchar类型的,结果返回的是全集,改为a.poruid = "0"的时候查出来的猜我我想要的结果,很奇怪,有数据库方面的大神能解答一下吗?varchar类型与数字比较的机制吗?我主要是想知道为什么不加引号的时候返回的是全集,,,

Related labels:
source:php.cn
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