On 12/5/2013 1:43 PM, Hayden Livingston wrote:
Yes, are moving our sparse matrix to different tables:
Id | RelationalIdentifier | ColA
1 a X
2 b A
Id | RelationalIdentifier | ColB
1 a Y
2 b B
Id | RelationalIdentifier | ColC
1 a Z
2 b C
Why? Personally, I'd have one table: either
Id, RelationalIdentifier, ColA, ColB, ColC
1, a, X, Y, Z
2, b, A, B, C
or
Id, RelationalIdentifier, Col, Value
1, a, ColA, X
1, a, ColB, Y
1, a, ColC, Z
2, b, ColA, A
2, b, ColB, B
2, b, ColC, C
depending on how open-ended the list of columns is. It's also not clear
what the purpose of Id and RelationalIdentifier is; they appear
duplicative of each other.
How can I adapt your query to this new table schema?
select RelationalIdentifier, ColA, ColB, ColC
from TableA join TableB using (RelationalIdentifier) join TableC using
(RelationalIdentifier);
--
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users