i want to get count of groupby (bebleiotheque.type), its work but whene i add multiple many2many fields to get multiple books or multiple employer for each bebeliotheque row, my count get rise
howa to get real count of groupby (bebeliotheque type)
take a look in my app list bebeliotheque, i regroup all same bebeliotheque name but I have an incorrect (count)
preview
image > http://rezigdev.com/image_202112522328.jpg
video > https://rezigdev.com/preview.mp4
sql query
SELECT
bibliotheque.name, GROUP_CONCAT(book.name) as books, GROUP_CONCAT(employers.name) as employers, COUNT(bibliotheque.name)
FROM
bibliotheque
left join
x_x_bibliotheque_book
ON x_x_bibliotheque_book.bibliotheque_id = bibliotheque.id
left join
book
ON x_x_bibliotheque_book.book_id = book.id
left join
x_x_bibliotheque_employers
ON x_x_bibliotheque_employers.bibliotheque_id = bibliotheque.id
left join
employers
ON x_x_bibliotheque_employers.employer_id = employers.id
Group BY
bibliotheque.name