0
如何將以下sql
查詢更改爲yii2
。如何將sql查詢更改爲yii2
SELECT
a.id, a.name_of_flight, a.time_of_flight, (no_of_passenger-b.cnt) as avail
FROM
flight_schedule a
LEFT JOIN
(SELECT flight_time, COUNT(id) AS cnt FROM book_eticket WHERE flight_date='2016-06-01' GROUP BY flight_time) b
ON a.id = b.flight_time
更好地解釋你的問題最終會顯示你的代碼的其餘部分......這個問題不明確 – scaisEdge
使用Joinwith概念 –