I'd take regular expressions, sure, but, how do you get SQLite syntax to take that on?
On Fri, Nov 10, 2017 at 8:45 AM, Don V Nielsen <[email protected]> wrote: > 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 < > [email protected]> wrote: > >> On 11/9/17, 2:51 PM, "sqlite-users on behalf of Stephen Chrzanowski" < >> [email protected] on behalf of >> [email protected]> 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 >> like: >> > >> > 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 >> [email protected] >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >> > _______________________________________________ > sqlite-users mailing list > [email protected] > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

