7 lines
273 B
Text
7 lines
273 B
Text
# Given two tables, A and B, representing two matrices in (i,j,value) format, the product
|
|
# can be computed as follows, with the result being in the same format.
|
|
SELECT A.i, B.j,
|
|
SUM(A.value * B.value) AS value
|
|
FROM A INNER JOIN B
|
|
ON A.j = B.i
|
|
GROUP BY A.i, B.j;
|