Re: [sqlite] finding pairwise similarity

2012-01-14 Thread Jean-Christophe Deschamps
where `similarity` is a measure of overlap of `t` between each pair of `c` and is calculated as the number of `t` common between a given pair divided by the total number of unique `t` in the pair. Just like Igor, I take "unique `t` in pair" to mean "distinct `t` in pair". I want the resul

Re: [sqlite] finding pairwise similarity

2012-01-14 Thread Igor Tandetnik
Mr. Puneet Kishor wrote: > I have two tables like so > >CREATE TABLE c (c_no INTEGER PRIMARY KEY, c_name TEXT); >CREATE TABLE t (t_no INTEGER PRIMARY KEY, t_name TEXT); >CREATE TABLE c_t (c_no INTEGER, t_no INTEGER); > > Every row in `c` has one or more `t`. I want, in a single SQL,

[sqlite] finding pairwise similarity

2012-01-14 Thread Mr. Puneet Kishor
I have two tables like so CREATE TABLE c (c_no INTEGER PRIMARY KEY, c_name TEXT); CREATE TABLE t (t_no INTEGER PRIMARY KEY, t_name TEXT); CREATE TABLE c_t (c_no INTEGER, t_no INTEGER); Every row in `c` has one or more `t`. I want, in a single SQL, the following source_c, targ