数据库多表并查
涉及多表并查的情况,我们先只讨论不用左右外连接等方式,而是通过结果集来取最后的数据。 select r.*, (select count(collector_id) from lj_garbagecollector where left(collector_id,length("330681117")+3) = r.region_id) as collector_num, (select count(household_id) from lj_household where left(household_id,length("330681117")+3) = r.region_id) as h
用户评论