DatabaseException

Expression #1 of ORDER BY clause is not in SELECT list, references column 'elgg_ocd.ann1.id' which is not in SELECT list; this is incompatible with DISTINCT

QUERY: SELECT distinct ent.guid, ann1.time_created
FROM elgg_entities ent
INNER JOIN elgg_entity_subtypes sub ON ent.subtype = sub.id
AND sub.subtype = 'image'
INNER JOIN elgg_annotations ann1 ON ann1.entity_guid = ent.guid
INNER JOIN elgg_metastrings ms ON ms.id = ann1.name_id
AND ms.string = 'tp_view'
ORDER BY ann1.id DESC
LIMIT 200