Is there any way to do this?
SELECT sum(price) from table2 WHERE id=(SELECT theid FROM table1 WHERE user_id="myid")
I have table1 with the identifiers of the elements that the user bought. I want to calculate the sum of all items purchased by the user.
Is the request above legal? If not, what is the correct form?
mysql select
Cristy
source share