SELECT t1.id,
t1.serial,
t1.area_name,
t1.area_code,
t1.parent_serial AS parentSerial,
COUNT(t2.district_id) AS store_count,
t1.create_time,
t1.update_time,
t1.sup_count
FROM sr_district t1
LEFT JOIN yx_system_store t2 ON t2.district_id = t1.id
GROUP BY t1.id
一张表查询关联表统计
最新推荐文章于 2022-05-10 15:08:30 发布