mercredi 29 novembre 2017

Require Laravel query explanation.

Can anyone explain me what does IF(transactions.retail_cost > 0,1,0) means from the below query ?

       $query = Distributors::selectRaw("distributors.name,distributors.group_id,distributors.pay,SUM(IF(transactions.retail_cost > 0,1,0)) AS trans_number"); 



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire