Reputation: 77
I am new to Laravel.
I have a database table named A and column names are 1,2,3 .
In column 3 i have different values like a,b,c. Now what i want is to print out the total no of values of a,b and c using group by clause. Sorry for my bad English. Thanks in advance.
i am doing it like
$cot=DB::table('A')->group By('3')->count();
echo $cot;
Upvotes: 2
Views: 59
Reputation: 922
There seems to be a space in the query.
It should look like the below.
$cot = DB::table('A')->groupBy('3')->count();
echo $cot;
Upvotes: 1