Re: why does left join gives more results?
- Date: Sun, 4 May 2008 19:37:22 -0500
- From: "Patrick Aljord" <patcito@xxxxxxxxx>
- Subject: Re: why does left join gives more results?
> Your doing a left join which can increase the number of rows returned.
> This is then GROUP BYed and run through a HAVING. Is:
> posts.poster_id=users.id
> a one to one relationship? If it is not, then count(*) would be a
> larger number and pass the HAVING. This may not be your problem, but I
> suggest you have more than you realize.
this is not a one-to-one as a user can make many comments but a
comment belongs to one user only, so I guess the left join returns
more than necesary. but I'm kind of stuck on that one :/
> I suggest reading
> http://www.xaprb.com/blog/2006/04/26/sql-coding-standards/
I read it thanks but I still can't find a way to do it right, I mean I
am following this pattern right no?:
select column ...
from table ...
where criterion ...
group by groupingclause ...
having havingclause ...
order by orderingclause ...
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