0
select * from amos.equipment_oil
inner join (
select max(creation_date) as MaxDate
from amos.equipment_oil
group by DATE_FORMAT(creation_date, '%m-%d-%Y')
) tm on equipment_oil.creation_date= tm.MaxDate
where equipment_id = $id
order by creation_date asc
我想將其轉換成laravel 5查詢。請幫忙。 這是我到目前爲止。
$equipmentOil = EquipmentOil::where('equipment_id', $id)->orderBy('creation_date', 'asc')->get();