Hello, I am trying to run a query to get the publications, total pubids per publication and to return the latest one. For some reason, it always return the first one (oldest one). Please what am I doing wrong
SELECT p.period, count(pubid) as count, f.forumid, f.title FROM forum f
LEFT JOIN pub AS p ON(f.forumid = p.pubid)
WHERE f.forumid IN (2,3, 4,5) AND p.mvisible = 1 GROUP BY f.forumid ORDER BY p.period DESC