Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel How do I get distinct values from the table along with the count of how many rows there are containing that value

Model::query()->groupBy('country_name')->select('counrty_name',DB::raw('COUNT(1)'))->get()
 
PREVIOUS NEXT
Tagged: #Laravel #How #I #distinct #values #table #count #rows
ADD COMMENT
Topic
Name
6+7 =