SELECT i.*, CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams, u.userName AS nomeColunista , u.image AS imgColunista , u.userID AS idColunista FROM #__k2_items as i RIGHT JOIN #__k2_categories c ON c.id = i.catid LEFT JOIN #__k2_users u ON u.userID = i.created_by WHERE i.published = 1 AND i.access IN(1,1,5) AND i.trash = 0 AND c.published = 1 AND c.trash = 0 AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2024-10-03 23:16:07' ) AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2024-10-03 23:16:07' ) AND i.catid=31 AND i.catid IN(31) OR i.id IN (SELECT itemID FROM #__k2_additional_categories WHERE catid IN(31 ) ) ORDER BY i.publish_up DESC LIMIT 0 , 2