Support the ongoing development of Laravel.io →
Eloquent Database
Last updated 1 year ago.
0

hi, you can use db::raw('select Distinct count * from tables')

0

Thanks for the reply Ramin.

I have tried your suggestion, but didnt work as expected. I need to fetch details from both the tables. So I am using a left join for this.That is why I have used distinct() function to prevent duplicate records. I am getting all the records as expected, but while using the Laravel "paginate()" function, the total count returned is wrong - the count returns the number of all records(Including duplicates).

Last updated 6 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.