SQL: I want use the wildcard "%" in the IN clause but I'm not getting the results I expect. My query is like this
SELECT DISTINCT ID,
FROM INST
WHERE TYPE in ('IP_%_International')
Please help resolve this and the solution should be with the IN clause.
You can't do that. IN is for literals, percent signs are for LIKE. Sorry! So WHERE type LIKE 'IP_%_International'
. But if you have several patterns , the only thing you can do is to OR them together.WHERE type LIKE 'IP_%_International' OR type LIKE 'some_%_other_pattern'
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