Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column '' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by SELECT i.*,i.is_top as top,FROM_UNIXTIME(i.post_dateline) AS post_datetime,FROM_UNIXTIME(i.last_dateline) AS last_datetime,f.thread_link FROM bbs_inforums AS i LEFT JOIN forum_forums AS f ON i.forum_id = WHERE i.is_top = 2 AND i.forum_id IN (6,5,7,8,9,4,32,2,3,12,33,1,10,11) GROUP BY i.thread_id ORDER BY i.last_dateline DESC