How can I check for a substring in a string in Oracle without using LIKE? Let’s say I want to select all users from a table that have the letter "z" in their last name:
SELECT * FROM users WHERE last_name LIKE '%z%';
That would work, but I don’t want to use LIKE. Is there some other function I could use?
I’m guessing the reason you’re asking is performance?
There’s the instr function. But that’s likely to work pretty much the same behind the scenes.
Maybe you could look into full text search.
As last resorts you’d be looking at caching or precomputed columns/an indexed view.