0
例如:如何在yii中的CDbCriteria和CActiveDataProvider中編寫mysql子查詢?
SELECT * FROM (
SELECT *
FROM `servicelist` `t`
WHERE t.is_accept_by_driver = 0) as tmp GROUP BY servicenumber
例如:如何在yii中的CDbCriteria和CActiveDataProvider中編寫mysql子查詢?
SELECT * FROM (
SELECT *
FROM `servicelist` `t`
WHERE t.is_accept_by_driver = 0) as tmp GROUP BY servicenumber
試試這個:
\Yii::app()
->db
->createCommand(
"SELECT * FROM (
SELECT *
FROM `servicelist` `t`
WHERE t.is_accept_by_driver = 0) as tmp GROUP BY servicenumber"
)
->queryAll()
在於,在完整的查詢?該查詢沒有多大意義(尤其是使用子查詢)對我來說。 – Bfcm