时间:2021-07-01 10:21:17 帮助过:21人阅读
查询不为空的所有记录
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;