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<='2025-01-02' AND ( (pub_date_from is null AND pub_date_to is null) OR (pub_date_from is null AND pub_date_to >= '1743550464') OR (pub_date_from <='1743550464' AND pub_date_to is null) OR (pub_date_from <='1743550464' AND pub_date_to >='1743550464') ) AND status='A' ORDER BY date desc