DBConnect Errors : Expression #1 of ORDER BY clause is not in SELECT list, references column 'fehdnewdb.hkied_content_live.date' which is not in SELECT list; this is incompatible with DISTINCT
SELECT distinct(DATE_FORMAT(date,'%Y')) as year FROM hkied_content_live WHERE deleted='N' AND type='highlight' AND (site=_utf8'celt' OR sharesite like _utf8'%celt%') AND date<='2024-12-31' AND ( (pub_date_from is null AND pub_date_to is null) OR (pub_date_from is null AND pub_date_to >= '1743407340') OR (pub_date_from <='1743407340' AND pub_date_to is null) OR (pub_date_from <='1743407340' AND pub_date_to >='1743407340') ) AND status='A' ORDER BY date desc