2

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;

1 Answer 1

1

There seems to be a space in the query.

It should look like the below.

$cot = DB::table('A')->groupBy('3')->count();

echo $cot;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.