01-02-2008, 02:23 AM
|
#2 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
Hmmm. I don't see any immediate issues standing out. Could you possibly attach your MySQL dump with dummy data so we can emulate and ponder?
I reformatted the SQL if anybody else wishes to have a stab at it.
sql Code:
SELECT votes.poll_id AS votes_pollid, COUNT(item_id) AS count, item_id, items.* FROM votes LEFT JOIN items ON votes.id = items.poll_id WHERE votes.poll_id = 1 GROUP BY item_id ORDER BY count DESC LIMIT 3;
Personal preference really on the formatting! 
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|