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