标签:
例子:
$sql = ‘SELECT SUM(o.price) as `sum` FROM `order` o WHERE o.customer_id =‘.$profile->id;$ret = Yii::$app->db->createCommand($sql)->queryScalar();
Yii PHP sum SQL查询语句
原文地址:http://www.cnblogs.com/CheeseZH/p/4580090.html