Welcome Guest, Not a member yet? Register   Sign In
Showing number of comments in blog (while listing all posts)
#10

[eluser]sl3dg3hamm3r[/eluser]
[quote author="kgill" date="1252525124"]There’s a problem with jegbagus’ code - if a post has no comments it won’t be selected. Do yourself a huge favour and find a tutorial on SQL joins - if the terms outer join are daunting then you need to read up on them not ask for simpler solutions. Without that knowledge you’re both unaware a problem existed and that the code sl3dg3hamm3r posted fixed it using a left outer join - if he hadn’t you’d be implementing a solution that only partially works.[/quote]
I was fast-reading and didn't even notice - spot on, you're absolutely right. That's why I always use proper join-syntax, like that I usually consider 'left' and 'inner' always correctly right from first attempts.
Besides, queries are way more readable like that...


[quote author="kgill" date="1252525124"]@sl3dg3hamm3r you're nicer than I am - I'm a crusty old curmudgeon who would have left it to him to figure out for himself, I mean and don't spoon-feed answers.[/quote]
Had a boring minute Wink


Messages In This Thread
Showing number of comments in blog (while listing all posts) - by El Forum - 09-09-2009, 08:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB