mysql 根据where条件,分组,联表等统计数据条数
时间:2021-07-01 10:21:17
帮助过:19人阅读
"
SELECT count(
*)
as totalNum
from beauty_photos
as p
left join beauty_user
as u
on p.uid
=u.id
where p.status
=1 and p.is_delete
=0 and u.is_delete
=0 group by p.uid";
$count = \Yii::$app
->db4
->createCommand($sql)
->queryAll();
mysql 根据where条件,分组,联表等统计数据条数
标签:font 方法 sql yii com man sele create 遇到