两张表里面查询各自的记录总数
SELECT count(rz_refer.refer_id) as refer,count(rz_client.client_id) as fault
FROM rz_refer,rz_client
从两张表里面查询各自的记录总数,我这样查有什么问题?
我查出的结果总是refer和fault的值相等,应该怎么该?
[解决办法]
SELECT count(rz_refer.refer_id) as refer,(select count(rz_client.client_id) as fault from rz_client)
FROM rz_refer