lundi 17 août 2020

Laravel, how to use select AS in where query?

        $data['losers'] = $data['losers']
            ->select(DB::raw('ROUND((((users_24h-users_48h_24h) / users_48h_24h) * 100),2) AS daypercentage, name'))
            ->where('daypercentage', '>=', '0')

If i use daypercentage in my where query, it can´t be found. How would that be possible in this case?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire