lundi 13 novembre 2017

Count in Eloquent with distinct?

the following query:

Sheep::whereIn('foobar_id', [1, 2, 3, 4, 5])->groupBy('foobar_id')->count();

Also instead of using groupBy I tried distinct('foobar_id') with no effect. How can I get a result of the counts where doubles of the foobar_id are skipped? Using Postgres



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ACm9v7
via IFTTT

Aucun commentaire:

Enregistrer un commentaire