Please, I would like to concatenate an "AND" clause based on a variable value but I'm getting errors because of the 'LIKE' and '%%'.
This is what I'm doing:
Code: Select all
{occurrenceType == "M" ? " AND occurrence.fk_doc = " + doctor + "" : " AND patient.nameLIKE '%'" + {patient_name} + "%'"}
What is the correct way to escape a single quotation mark or use a clause WHERE using a variable?