SELECT p.id, p.parent, p.serid, p.date, e.id, e.title, e.poster FROM dle_epis p LEFT JOIN dle_news e ON (p.serid=e.id) GROUP by p.serid ORDER by p.date DESC LIMIT 30
SELECT *
FROM
(
SELECT *
FROM `table`
ORDER BY `date` DESC
) as `new_table`
GROUP BY `test_id`