Assuming you are looking for "Abc" or "Def" anywhere in the argument, how
about regular expression? (Abc|Def)
On Thu, Nov 9, 2017 at 3:00 PM, Peter Da Silva <
> On 11/9/17, 2:51 PM, "sqlite-users on behalf of Stephen Chrzanowski" <
> sqlite-users-boun...@mailinglists.sqlite.org on behalf of
> pontia...@gmail.com> wrote:
> > I've added a simple filter function that uses SQLites LIKE operator, but
> I'd like something a little bit more advanced. Right now, the SQL code is
> > select * from Events where Title like '%Abc%Def%'
> > This works if the Title is AbcRfeDef, but would fail with FedRfeAbc.
> > I've thought about doing some kind of delimiter, then have the code
> generate the SQL code by just looping through the keywords and generate the
> "or Title like '%keyword%'" statement (With appropriate escaping), but that
> just smells bad to me.
> The best way to do it is not to use complex keys, but if you have to (say
> because the input is free form) then generating
> SELECT * FROM EVENTS WHERE title LIKE ‘%Abc%’ AND title LIKE ‘%Def%’;
> is probably the only option.
> sqlite-users mailing list
sqlite-users mailing list