Home > Database > Mysql Tutorial > mysql查询字段不为空的记录_MySQL

mysql查询字段不为空的记录_MySQL

WBOY
Release: 2016-06-01 13:43:22
Original
1243 people have browsed it

bitsCN.com

查询不为空的所有记录
SELECT id,firstname,lastname,mail FROM testdb.users WHERE mail!='';
或者
SELECT id,firstname,lastname,mail FROM testdb.users WHERE LENGTH(mail)>0;

mysql查询一个表的记录的总数
SELECT count(*) FROM table_name;
或者
SELECT count(*) as num FROM table_name;



本文来自于 lynnteng0 的BLOG bitsCN.com
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