() ORDER BY `f_dod` DESC
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ORDER BY `f_dod` DESC' at line 1
select distinct(acts.h_id) from acts left join files using (f_id) left join headnotes using(f_id,h_id) where () ORDER BY `f_dod` DESC ;