3065. Query Error 3065: Expression #1 of ORDER BY clause is not in SELECT list, references column 'kamaz61.ru.ap.sort' which is not in SELECT list; this is incompatible with DISTINCT
Query: SELECT DISTINCT p.*,p.id,p.ext,p.hash,p.status FROM photos_photo p JOIN photos_album_photos ap ON p.id = ap.photo_id WHERE ap.album_id = 1 AND p.status = 1 AND p.url IS NOT NULL AND LENGTH(TRIM(p.url)) > 0 AND p.parent_id = 0 ORDER BY ap.sort ASC LIMIT 500
Запрашиваемый ресурс недоступен.