title: SQL | Return MIN values | multiple rows dynamically
body: <p>I need to create a query that returns only the rows which have the minimum values in a specific column. </p>
  
  <p>I have this results (example):</p>
  
  <pre><code>Name  |  Description  | Order
  -----------------------------
  Name1 |  A            | 1
  Name1 |  B            | 2
  Name1 |  C            | 3
  Name2 |  A            | 1
  Name2 |  B            | 2
  Name2 |  C            | 3
  </code></pre>
  
  <p>I want to get this results:</p>
  
  <pre><code>Name  |  Description  | Order
  -----------------------------
  Name1 |  A            | 1
  Name2 |  A            | 1
  </code></pre>
  
  <p>Basically, I need to select only the rows which have the minimum value in the column <strong>order</strong>.</p>
  
  <p>I'm stuck with queries like <strong>Query A</strong>:</p>
  
  <pre><code>Select Top 1 *
  From table1
  Where Name = 'Name1'
  Order by Order
  </code></pre>
  
  <p>Or <strong>Query B</strong>:</p>
  
  <pre><code>Select *
  From table1
  Where Name = 'Name1'
   and order = (Select min(Order)
                From table1
                Where Name = 'Name1')
  </code></pre>
  
  <p>What I need is to have in a single query, the capability of returning the rows for multiple names, instead of having to do queries per name. Is there any way, to pass attributes values to the subquery in the example of <strong>Query B</strong>?</p>
  
  <p>What are the alternatives?</p>
  
  <p>The platform is SQL Server 2012. </p>