扫码关注官方订阅号
select t.name,(select count(id) from b as t1 where t1.aid=t.id) num from a as t;这个sql还有其他什么写法吗,能做成关联查询吗?
光阴似箭催人老,日月如移越少年。
select a.name, s.count from a, ( select aid, count(aid) as count from b group by aid ) as s where a.id = s.aid
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
光阴似箭催人老,日月如移越少年。