I am trying to count several joined tables, but without luck I get the same numbers for each column (tUsers,tLists,tItems) . My request:
select COUNT(users.*) as tUsers, COUNT(lists.*) as tLists, COUNT(items.*) as tItems, companyName from users as c join lists as l on c.userID = l.userID join items as i on c.userID = i.userID group by companyID
As a result, I want to get
---------------------------------------------
What changes do I need to make for my request to get these results?
Greetings
source share