select a.code, a.title, date_modified, image_url from articles as a join articles_groups_members as agm using (article_id) join articles_groups as ag using (group_id) where date_posted < now() and ag.group_id in (24) AND (isnull(notes) OR notes not like '%DNR%' OR date_posted > date_sub(now(),INTERVAL 6 MONTH)) order by code asc;