I have searched this question, and found an answer in MySQL but this is one of those incidents where the statement fails to cross over into Oracle.
Can I use wildcards in "IN" MySQL statement?
pretty much sums up my question and what I would like to do, but in Oracle
I would like to find the legal equivalent of
Select * from myTable m where m.status not in ('Done%', 'Finished except%', 'In Progress%')
Thanks for any help
You can also using the % wildcard multiple times within the same string. For example, SELECT last_name FROM customers WHERE last_name LIKE '%er%'; In this Oracle LIKE condition example, we are looking for all customers whose last_name contains the characters 'er'.
If you want to select records in which a string matches a specific pattern, you can use a LIKE clause as the condition in a WHERE clause.
The pattern includes the following wildcard characters: % (percent) matches any string of zero or more character. _ (underscore) matches any single character.
Select * from myTable m where m.status not like 'Done%' and m.status not like 'Finished except%' and m.status not like 'In Progress%'
It seems that you can use regexp too
WHERE NOT REGEXP_LIKE(field, '^Done|^Finished')
I'm not sure how well this will perform though ... see here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With