On 3 Dec 2010, at 11:14pm, Drake Wilson wrote:

> Another would be to
> rewrite the query to union the two directions together

You could do this with a VIEW, of course.  Have a VIEW that reflects the UNION 
of the 'know' table with its elements in the opposite order.  Then query this 
VIEW instead of the original table.

An alternative which would lead to faster code would be a TRIGGER which every 
time something was put in the 'know' table inserted another record with the 
elements reversed.  It should, of course, be an INSERT OR IGNORE, and you'd 
need a UNIQUE key on the table to prevent duplication.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to