title: SQL selecting minimum value in a sub query when exact value is unknown
body: <p>I have an SQL query that is meant to select a list of things from different tables using a subquery. I am meant to find those things with the lowest value in a particular column.</p>
  
  <p>This is the query that i currently have. I know the minimum rate is 350 but i cant use it in my query. Any effort to change it to MIN(rate) has been unsuccessful.</p>
  
  <pre><code>  SELECT DISTINCT name
    FROM table1 NATURAL JOIN table2
    WHERE table2.code = (SELECT Code FROM rates WHERE rate = '100')
  </code></pre>
  
  <p>How do i change that subquery to find the minimum rate?</p>