title: Mysql select distinct but limit the distinct values
body: <p>This might be confusing but what I want to do is a basic select distinct columnx limit 3, the problem I have is it returns 3 rows, but I only want to get all values from one distinct columnx.</p>
  
  <pre><code>id|columnx  
  1 |here  
  2 |here  
  3 |Idontwant  
  4 |Apple
  </code></pre>
  
  <p>so I want a query that will return 1 and 2.  The problem is columnx could be anything and I cant just say where columnx = 'here'</p>
  
  <p>The limit 3 comes into play because it's hard coded into my C# app.  The issue is i also set a hashset based on columnx, i have to have that columnx static for all records.  However, with every query i put together there is the possibility that with my limit i'll return 2 values in columnx, which are distinct values however, i can only have distinct columnx value per query.</p>
  
  <p>No what I want is all values that belong to columnx, in this example columnx ='here', when i do a distinct all I want back is the first distinct result, not 'Idontwant' or 'apple' regardless of the limit.</p>
  
  <p>Here is the query and it works.</p>
  
  <pre><code>SELECT id,columnx
  FROM sites where columnx= (select distinct columnx from sites limit 1) limit 3
  </code></pre>