On the first query inside the FROM () I GROUP BY seriesId. The issue I'm having is that I want it to GROUP BY using the newest date from g.releaseDate but when I add the ORDER BY g.releaseDate DESC I get the following error:
Message: Incorrect usage of UNION and ORDER BY
SELECT newsTitle, newsPage, newsNav
FROM
(
SELECT gs.title AS newsTitle, g.page AS newsPage, g.navigationPanel AS newsNav, g.releaseDate AS newsReleaseDate
FROM `rs_news` g
INNER JOIN `rs_news_series` gs ON g.seriesId=gs.id
WHERE g.featured='1' AND g.seriesId!='0'
GROUP BY g.seriesId //ORDER BY g.releaseDate DESC
UNION ALL
SELECT g.title AS newsTitle, g.page AS newsPage, g.navigationPanel AS newsNav, g.releaseDate AS newsReleaseDate
FROM `rs_news` g
WHERE g.featured='1' AND g.seriesId='0'
) AS `news`
ORDER BY newsReleaseDate DESC
Is there any way of getting the group by to group into the newest releaseDate rather than choosing whichever record it feels like to group?