Cambiar where id=(SELECT
a where id IN (SELECT
O lo que realmente quieres es probablemente:
SELECT sum(price) FROM table2 INNER JOIN table1 ON table2.id = table1.theid WHERE table1.user_id = 'my_id'
Cambiar where id=(SELECT
a where id IN (SELECT
O lo que realmente quieres es probablemente:
SELECT sum(price) FROM table2 INNER JOIN table1 ON table2.id = table1.theid WHERE table1.user_id = 'my_id'