If a column is configured to allow selecting multiple options (Select list, Lookup) the SQL column will return the selected values separated by a space.
When you need to use user-data in your query, rather than try to escape it use a prepared query and bind the values to it. All of the building blocks have a values parameter that takes an array of string values you can bind to. In your query you can refer to these values with an equals sign ? , optionally followed by an index.
Query
Starts with
Country
Result
Query
Starts with
Country
Result
1
SELECT `First Name`
FROM Employees
WHERE `First Name` LIKE ? || '%'
M
Margaret
Michael
2
SELECT `First Name`
FROM Employees
WHERE Country = ?
USA
Nancy
Andrew
Janet
Margaret
Laura
3
SELECT `First Name`
FROM Employees
WHERE
Country = ?2 AND
`First Name` LIKE ?1 || '%'
M
USA
Margaret
There are no rows in this table
No extra values
Make sure that you use every value that you bind to the query. Unused values will cause the query to fail.
Want to print your doc? This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (