Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

MySQL:somando e multiplicando em tabelas diferentes

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