mysql中如何查询B表中有多少记录的某字段等于A表的字段

2025-03-23 02:07:59
推荐回答(2个)
回答1:

select count(*) from b,a where b.aid=b.id

回答2:

SELECT count(b.aid) FROM b as b
LEFT JOIN a as a
ON b.aid = b.id