$sql = "SELECT uid,user,email,subject,sex,age,address FROM user ORDER BY uid DESC LIMIT 10"
如果想查询email不为空值的记录,该怎么改呢?
如果空值是:NULL
NULL
则:
$sql = "SELECT uid,user,email,subject,sex,age,address FROM user WHERE email IS NOT NULL ORDER BY uid DESC LIMIT 10"
如果空值是:
$sql = "SELECT uid,user,email,subject,sex,age,address FROM user WHERE email !='' ORDER BY uid DESC LIMIT 10"
欢迎来到随意问技术百科, 这是一个面向专业开发者的IT问答网站,提供途径助开发者查找IT技术方案,解决程序bug和网站运维难题等。 温馨提示:本网站禁止用户发布与IT技术无关的、粗浅的、毫无意义的或者违法国家法规的等不合理内容,谢谢支持。