0
所以,讓我們直接:我掙扎幾天都轉換這個SQL語句:轉換SQL語句阿雷爾Rails的查詢
select * from (
select distinct on (program_id) editions.*, programs.*
from editions inner join programs on editions.program_id = programs.id
where programs.station_id = 1) as editionsprograms
order by fixed desc, published_at desc, time desc
limit 4;
到阿雷爾軌查詢。有人有任何想法可以使一個Arel查詢具有上述SQL的相同效果嗎?
太棒了!我要去試試,謝謝! –