“奇怪”的MYSQL查询语句

yinghuaxingfu 2003-08-19 10:32:41
select count(*) as nums from online where username is not null
问题:is not null是什么作用,请朋友指教
...全文
51 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jkit 2003-08-19
  • 打赏
  • 举报
回复
is not null 表示非空.
mysql> select count(*) as nums from test where user_name is not null;
+------+
| nums |
+------+
| 5 |
+------+
1 row in set (0.00 sec)
Eraserpro 2003-08-19
  • 打赏
  • 举报
回复
统计所有username字段不为空的记录的数量吧!
is not null表示条件为username不为空!

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧