Re: [sqlite] Degrees of separation

2010-12-03 Thread Drake Wilson
Quoth Dariusz Matkowski , on 2010-12-03 18:46:20 -0500: > Phobic What? ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Degrees of separation

2010-12-03 Thread Dariusz Matkowski
Phobic - Original Message - From: Simon Slavin [mailto:slav...@bigfraud.org] Sent: Friday, December 03, 2010 06:36 PM To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Subject: Re: [sqlite] Degrees of separation On 3 Dec 2010, at 11:14pm, Drake Wilson wrote: >

Re: [sqlite] Degrees of separation

2010-12-03 Thread Simon Slavin
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

Re: [sqlite] Degrees of separation

2010-12-03 Thread Drake Wilson
Quoth "Black, Michael (IS)" , on 2010-12-03 17:07:23 -0600: > INSERT INTO "know" VALUES('a','b'); > INSERT INTO "know" VALUES('a','c'); > INSERT INTO "know" VALUES('a','d'); > INSERT INTO "know" VALUES('aa','b'); > INSERT INTO "know" VALUES('b','bb'); > INSERT INTO "know"

[sqlite] Degrees of separation

2010-12-03 Thread Black, Michael (IS)
I need a bit of SQL expertise here...I'm close but not close enough and joins kind of confuse me. Given the following table of 1-degree separations I want to get the 2-degree separations CREATE TABLE know(p1 varchar,p2 varchar); CREATE INDEX know_idx on know(p1,p2); INSERT INTO "know"