Normally createdBy is going to be an integer that is a userID of the person who created the document. This works great so far but now we have realized there will be instances where some people will need to pull documents created by all users. If that is the case... instead of the variable createdBy being an integer such as 15 it would be the string "all".SELECT * FROM documents WHERE createdBy = {createdBy}
I wondered if it was possible to put a conditional in the query so that we can evaluate createdBy and if it is equal to "all" we have one query otherwise we have another query.
For example if createdBy = all I would like the query passed to be:
and if the createdBy != all the query passed would be:SELECT * FROM documents
Hopefully I explained that well enough to make sense.SELECT * FROM documents WHERE createdBy = {createdBy}
Thanks for the assistance.
-BB