[Solved] Mysql display random 4 users with more than 5 articles
I’ve mocked up some table data to test my query. WHERE clauses must be positioned after JOINs. You are also a little ambiguous about the comparison of COUNT AND 5 — if you want more than 5 then >5, if you want 5 or more then >=5. SQL: (SQLFiddle Demo) SELECT a.user_id,a.username,COUNT(b.user_id) FROM users a … Read more