why does left join gives more results?
- Date: Sat, 3 May 2008 20:00:17 -0500
- From: "Patrick Aljord" <patcito@xxxxxxxxx>
- Subject: why does left join gives more results?
hey all,
I have my query that counts posts per user:
SELECT count(*) as counted, c.user_id FROM posts c group by c.user_id
having counted>1 order by counted DESC LIMIT 20
I wanted to add user login for each count so I did:
SELECT count(*) as counted, u.login FROM posts c left join users u on
posts.poster_id=u.id group by c.user_id having counted>1 order by
counted DESC LIMIT 20
but now I get more results.
Any idea what I'm doing wrong?
Thanks in advance
Pat
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=royale@xxxxxxxxxx