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

SUM(sottoquery) in MySQL

Perché non lo fai:

SELECT m.col1, (SELECT SUM(col5) FROM table WHERE col2 = m.col1)
FROM table AS m