SELECT * ,
count(*) as num_row ,
tbl_posts.id AS post_id,
tbl_posts.public_id AS post_public_id
FROM tbl_posts
INNER JOIN tbl_users ON tbl_users.id = tbl_posts.user_id
WHERE slug= "wrong slug" AND
tbl_posts.public_id = "wrong id"
GROUP BY post_id
我尝试同时计算行数并获取数据,如果 条件正确但条件错误时COUNT函数不显示“ 0”,为什么以及如何解决?