0
我有這樣的查詢:使用Laravel 5中的查詢生成器進行復雜查詢(使用三級子查詢)?
SELECT p.*, t3.gambar_meteran, t3.angka_meteran
from pelanggan p
LEFT JOIN (SELECT t1.*
FROM tagihan t1
JOIN (SELECT no_rek_pelanggan, MAX(created_at) created_at
FROM tagihan
GROUP BY no_rek_pelanggan) t2
ON t1.no_rek_pelanggan = t2.no_rek_pelanggan
AND t1.created_at = t2.created_at) t3
ON p.no_rek = t3.no_rek_pelanggan`
我如何使用,在laravel 5.2複雜的查詢?
我嘗試過很多辦法像使用DB::raw
,DB:statement
等
請分享自己的所有嘗試究竟什麼錯誤信息或者你遇到的意外行爲! – Shadow