Using MySQL, is there a way to use something similar to the "LIKE '%closed%' but used in the "NOT IN()" function?
I have data in a table that allows the end user to specify their own "closed" status for a work order. Some of the users write their own status as follows:
Closed
Pending Approval
1-Open
3-Closed
2-In progress
Pending
As you can see, I have a status called "3-Closed". I am trying to gather all the records that are NOT considered "closed", but this "3-Closed" will not work with my "NOT IN()" sql below.
SELECT * FROM my_table WHERE
p_wo_status_cat_id IN
(
SELECT b1.p_wo_status_cat_id
FROM p_status_list b1
WHERE LOWER(b1.name) NOT IN('completed','finished','done','closed')
)
Is there a way to do some thing like this:
NOT IN ('%closed%')
so it would pick up any variances of the word "closed"?
Thanks in advance.