title: SQL - ORDER BY ASC LIMIT 1 excludes multiple same results - best method?
body: <p>I'm still learning SQL so I was wondering if there is a better way of doing the following.</p>
  
  <p>I need to get row data for the lowest and highest values in a column (lets call it columnA).
  I would use:</p>
  
  <pre><code>SELECT *
    FROM table
   ORDER BY columnA
    DESC LIMIT 1
  </code></pre>
  
  <p>Problem is I get only one result due to the <code>LIMIT 1</code> but there may be identical lowest / highest values in ColumnA that have different values in the other columns. I need those other rows too.</p>
  
  <p>There is <code>SELECT(MAX)</code> but I believe that will also only produce one row of data.</p>
  
  <p>The ways I can think do this are by putting the highest / lowest columnA values into a variable and then back into a second query <code>OR</code> use a <code>LEFT JOIN</code> on alias tables to do this in single query but is there any more direct method?</p>