| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Patrick Aljord | Date: | May 4 2008 3:00am |
| Subject: | why does left join gives more results? | ||
| View as plain text | |||
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
| Thread | ||
|---|---|---|
| • why does left join gives more results? | Patrick Aljord | 4 May 2008 |
| • Re: why does left join gives more results? | Rob Wultsch | 4 May 2008 |
| • Re: why does left join gives more results? | Patrick Aljord | 5 May 2008 |
| • Re: why does left join gives more results? | Rob Wultsch | 5 May 2008 |
| • Re: why does left join gives more results? | Brent Baisley | 5 May 2008 |
