统计总数
SELECT h.*,IFNULL(count(r.pid),0) AS 总数 FROM rts_room AS r RIGHT JOIN rts_house AS h ON r.pid = h.Id AND r.state != 3 WHERE h.state = 0 GROUP BY h.Id
统计总数
SELECT h.*,IFNULL(count(r.pid),0) AS 总数 FROM rts_room AS r RIGHT JOIN rts_house AS h ON r.pid = h.Id AND r.state != 3 WHERE h.state = 0 GROUP BY h.Id
内容版权声明:除非注明,否则皆为本站原创文章。