where id=(SELECT
を変更します where id IN (SELECT
または、本当に必要なのはおそらく:
SELECT sum(price) FROM table2 INNER JOIN table1 ON table2.id = table1.theid WHERE table1.user_id = 'my_id'
where id=(SELECT
を変更します where id IN (SELECT
または、本当に必要なのはおそらく:
SELECT sum(price) FROM table2 INNER JOIN table1 ON table2.id = table1.theid WHERE table1.user_id = 'my_id'