计算用户留言的总数,select COUNT(USER) as total,USER from book where USER=48 group by USER发现如果“48”用户没有留言的话,就查不到记录,理想是能有反馈的结果,如total USER0 48

来源:学生作业帮助网 编辑:作业帮 时间:2024/03/29 00:06:03
计算用户留言的总数,select COUNT(USER) as total,USER from book where USER=48 group by USER发现如果“48”用户没有留言的话,就查不到记录,理想是能有反馈的结果,如total USER0 48

计算用户留言的总数,select COUNT(USER) as total,USER from book where USER=48 group by USER发现如果“48”用户没有留言的话,就查不到记录,理想是能有反馈的结果,如total USER0 48
计算用户留言的总数,select COUNT(USER) as total,USER from book where USER=48 group by USER
发现如果“48”用户没有留言的话,就查不到记录,理想是能有反馈的结果,

total USER
0 48

计算用户留言的总数,select COUNT(USER) as total,USER from book where USER=48 group by USER发现如果“48”用户没有留言的话,就查不到记录,理想是能有反馈的结果,如total USER0 48
select case when COUNT(USER) >0 then COUNT(USER) else 0 end as total,USER from book where USER=48 group by USER
你用类似这样的方法试试看