SELECT c.*, r.name AS photo, re.url
FROM de_content AS c
LEFT JOIN de_resource AS r ON c.content_id = r.foreign_id AND r.module='content'
LEFT JOIN de_redirect AS re ON c.content_id = re.foreign_id AND re.module='content'
WHERE c.home='yes'
GROUP BY c.content_id
ORDER BY c.created DESC
  (Expression #15 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dealokov_deal.r.name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by)
Deal