I don't know why I can't make this query work the way I want, I hope you can enlighten me.
SELECT e.id,
e.num,
e.name,
s.name as s_name,
t.num as t_num,
e.show_id
FROM s_episodes e
LEFT JOIN shows s ON s.id = e.show_id
LEFT JOIN s_seasons t ON t.id = e.season_id
GROUP BY e.show_id
ORDER BY e.dateadded DESC
dateadded is an int (unix timepost). e.num, t.num are also int.
Is is supposed to show the latest episodes added, but when the GROUP BY groups the rows, the episodes listed aren't the latest ones but the first episode (episode number indicated by e.num) of the latest season (season number indicated by t_num) of a show (however, shows are ordered by dateadded based on the latest episodes, but the episode listed is the first one of the season, not the last added).
Any ideas?
I hope I made myself clear, sorry for any english mistakes. Thanks.