Select distinct id from tm_templates a, tm_templates_to_categories b where a.visible=1 and a.id = b.template_id and (a.keywords like '%(ms %' OR a.software_required REGEXP '(ms') and adult=0 order by id desc
Got error 'parentheses not balanced' from regexp