Ubah where id=(SELECT
ke where id IN (SELECT
Atau yang sebenarnya Anda inginkan adalah:
SELECT sum(price) FROM table2 INNER JOIN table1 ON table2.id = table1.theid WHERE table1.user_id = 'my_id'
Ubah where id=(SELECT
ke where id IN (SELECT
Atau yang sebenarnya Anda inginkan adalah:
SELECT sum(price) FROM table2 INNER JOIN table1 ON table2.id = table1.theid WHERE table1.user_id = 'my_id'