On 12/15/08, aditya siram <aditya.si...@gmail.com> wrote:
> Hi all,
>  I am trying to implement an autocompleter with a sqlite backend. Is there a
>  way to search the database using wildcards/regexps's without reading the
>  entire search space into memory?
>
>  For example given  the rows:
>  'hello  world'
>  'goodbye world'
>   a query approximately like "* world" should return both.
>


and so it does...

sqlite> CREATE TABLE foo (a);
sqlite> INSERT INTO foo VALUES ('hello world');
sqlite> INSERT INTO foo VALUES ('goodbye world');
sqlite> SELECT * FROM foo WHERE a LIKE '%world';
hello world
goodbye world
sqlite> SELECT * FROM foo WHERE a GLOB '*world';
hello world
goodbye world
sqlite>

Read the docs on the difference between LIKE and GLOB
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to