I'm trying to fetch the most popular threads to show them in the portal, this is the query I have:
As you can see, I'm joining a different tables to order the threads by the number of "rates" the thread has had. In the above I just joined, the query still works as usual. The problem comes here:
I added:
That is suppose to count the number of rows for that thread, but that alone shouldn't affect the query at all, just that it does, the thread being pulled are no the same as the one before adding that piece of code.
This doesn't seem to work either.
But ", l.lid", ", l.*", or ", l.pid" does
Any clue?