How can i concatenate 2 LIKE operator as 1 for below query ?
select * from students where name LIKE 'abc%' OR name like '% abc%'
Please notice " " space after % wildcard in second like operator before 'abc'.
How can i concatenate 2 LIKE operator as 1 for below query ?
select * from students where name LIKE 'abc%' OR name like '% abc%'
Please notice " " space after % wildcard in second like operator before 'abc'.
Just ensure that all strings have that space:
SELECT * FROM students WHERE ' ' || name LIKE '% abc%';
For most databases, the LIKE
operator has pretty limited pattern matching (especially if you're used to regex-type pattern matching). SQLite is, as far as I can tell, one that fits that description. No one LIKE
pattern can do what you describe.