Mysql
 sql >> Database >  >> RDS >> Mysql

MySQL:addizione e moltiplicazione su tabelle diverse

SELECT SUM(first_table.link_id * second_table.factor) as ANSWER
FROM   first_table
LEFT JOIN second_table on first_table.link_id = second_table.id
WHERE  first_table.counted = 1