1
我怎麼會做笨的ActiveRecord以下查詢: -從子查詢中選擇笨的Active Record
SELECT *,
(SELECT
image_path
FROM
image
WHERE
image_table = 'model'
AND image_table_id = model_id
GROUP BY image_table_id
LIMIT 1) AS ModelImg
FROM
(SELECT
*
FROM
vw_newcars
where offer_table = 'derivative'
order by offer_order
) x
WHERE make_name = 'Fiat'
group by offer_table_id
limit 12
我有問題的部分是如何做到從子查詢中選擇的活動記錄。
我沒有看到from_select
函數或文檔中可比較的任何東西。
什麼版本的笨你用嗎? – Faiz