lundi 14 septembre 2020

Laravel - DB:raw

I need to set this query in Laravel and I believe that DB:Raw is the best alterntive, how can I set this query in Eloquent or as DB:raw?

SELECT      PROP_TYPE,
            concat(round(avg( prop_exclusive = 'Exclusiva' ) * 100, 0),'%') as Exclusiva,
            concat(round(avg( prop_exclusive = 'No Exclusiva' ) * 100, 0),'%') as No_Exclusiva
FROM        PROPERTIES
WHERE       PROP_MARKET_CENTER = 'KW' AND
            PROP_EXCLUSIVE IS NOT NULL
GROUP BY    PROP_TYPE
ORDER BY    PROP_TYPE ASC

Regards!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire