- 积分
- 5
- UID
- 318
- 阅读权限
- 10
- 注册时间
- 2008-3-9
- 精华
- 在线时间
- 小时
- 最后登录
- 1970-1-1
- 职业
- 1
|
简单的说就是,查询之后得出的结果为零。但是想具体的表现出来。
系统名称:新闻发布
需要功能:发表评论和点击次数
当查询发布的评论和点击的次数为0的时候
在数据库操作中如何得出这样的结果呢
表 名 1: t_comment 留言表
表 名 2:news_table 用户表
SELECT news_table.update_date, t_comment.user_id, t_comment.news_id, count( * ) AS counter FROM t_comment, news_table
WHERE news_table.user_id = t_comment.user_id
AND news_table.news_id = t_comment.news_id
GROUP BY t_comment.user_id, t_comment.news_id
ORDER BY news_table.update_date DESC
通过以上查询,发表过留言的用户可以得到结果 至少是1 但是前提是发表过留言
所以,想请教一下,mysql有不有查询之后,不符合条件的结果也可以得出,并且计算结果为0
谢谢
[ 本帖最后由 chenken 于 2008-3-9 15:05 编辑 ] |
|