-1
說我有此位的SQL:如何在Laravel的流利中進行子查詢?
select *
from `fluents`
inner join `tests` on `fluents`.`id` = `tests`.`fluent_test_id`
inner join (
select `fluents`.`id` from `fluents` order by `fluents`.`id` desc limit 10
) as j on `fluents`.`id` = `j`.`id`
order by `fluents`.`created_at`;
我知道我可以運行原始SQL但作爲一個學習的過程,我試圖將其轉換爲流暢慘遭失敗,這甚至可能?
使用DB :: query($ sql)爲laravel流利執行查詢。 –
我的意思是不使用查詢生成器,而不僅僅是簡單地執行原始SQL。 – rich97
好的你使用laravel 3還是4? –