rocknbil - 4:31 pm on Jul 26, 2010 (gmt 0)
Welcome aboard Malmo, I'm having trouble figuring out "what you're trying to do here." Perhaps you can define the goal. The programming itself is a bit vague as to what you're doing.
I constructed tables and emulated your example, and one thing I DID note was that when you punch this select into the command line,
novice.id, COUNT(novicaID) FROM novice,novice_komentarji WHERE novice_komentarji.novicaID = novice.id
GROUP BY novice.id ORDER BY novice.id = novice_komentarji.novicaID
It indeed echoes 5,2,5, there is no 0. So maybe that's at the root of it, or maybe it's a coincidence, not sure.