I know this has been asked a bunch but I still can't find a solution that works for me. Maybe with an answer here it will make more sense what is going on.
Tables:
tbl1: id, name
tbl2: id, tbl1_id, title, votes
I want to retrieve 1 record for each record in tbl1 with tbl2's highest value in "votes".
This is what I want but I know it doesn't work the way I am intended it to:
SELECT tbl1., tbl2. FROM tbl1 LEFT JOIN tbl2 ON tbl2.tbl1_id = tbl1.id GROUP BY tbl1.id ORDER BY tbl2.votes DESC
Display Page ex:
name, title, votes
name, title, votes
name, title, votes
name, title, votes
Any help would be great thank you.