I'm trying to return a value of true or false (or yes/no, etc.) as part of a select if a particular field in a table contains a substring.
- Select the ID, name, and whether or not a person is subscribed.
- A field called
emailList
has a comma separated list of names which should be used to check if the requester is subscribed. The result of the substring search should yield the true/false value as the result in another field.
The basic query would look like this:
SELECT
id,<...>,name
FROM
table
In the <...> area, I would want something equivalent to:
`emailList` contains @input ? "Yes" : "No"
I can't figure out how to do this to save my life. I'm guessing it can be done in other ways, but this seems like a good learning opportunity. Any suggestions?