title: MySql select inside another select?
body: <p>Is there any way to do this?</p>
  
  <pre><code>SELECT sum(price) from table2 WHERE id=(SELECT theid FROM table1 WHERE user_id="myid")
  </code></pre>
  
  <p>I have table1 with items' IDs, that a user has purchased. I want to calculate the sum of all items purchased by user. </p>
  
  <p>Is the query above legal? If not, what's the correct form?</p>