sql >> Base de Datos >  >> RDS >> Mysql

Cómo convertir mysql a generador de consultas laravel

$results = DB::select(
    select * from pages where (phase_id, type) 
    in (
        select max(phase_id), type 
        from pages 
        where phase_id <= 2 
        and actived = 1 
        group by type
    ) 
    and actived = 1
);