title: mySQL - how to select two distinct min values?
body: <p>I have a database where I have data that is communicated between two senders.
  The conversation is grouped by a session id.
  I want to get the two sender names per session, but I don't seem to find a way without losing sessions. </p>
  
  <p>The first sender always starts with a 'M'.
  The other sender is a UUID from an android device. (which normally wouldn't start with a capital letter, but is not required)</p>
  
  <p>my first attempt:</p>
  
  <pre><code>select max(sender) as 'first', 
         min(sender) as 'second' 
  group by session_id;
  </code></pre>
  
  <p>Here, in some cases the uuid starts with a number and I get the uuid for both first and second sender.</p>
  
  <pre><code>select min(sender) as 'first', 
         min(sender) as 'second' 
  where 'first' &lt;&gt; 'second' 
  group by session_id;
  </code></pre>
  
  <p>Here I lose the sessions where they are the same..</p>
  
  <p>How can I do this?</p>
  
  <p>Example data with min/max attempt = </p>
  
  <pre><code>'first'             'second'               'session'
  M4                   af568906754xxxxx       s1
  M4                   af568906754xxxxx       s2
  M4                   4da5c573191xxxxx       ...
  M5                   c8e953386eaxxxxx
  M5                   c8e953386eaxxxxx
  M7                   1b92d18d823xxxxx
  M7                   1b92d18d823xxxxx
  M7                   ac5a231d476xxxxx
  M7                   ac5a231d476xxxxx
  M7                   c8e953386eaxxxxx
  M7                   3266772f89dxxxxx
  M962f1a67a9xxxxx     M962f1a67a9xxxxx  (first should be M8)
  M95a231d476xxxxx     M95a231d476xxxxx  (first should be M8)
  M8                   c16a848a775xxxxx
  M8                   c16a848a775xxxxx
  M9                   bd3c04eeaf0xxxxx
  </code></pre>
  
  <p>second attempt will just not show these two..</p>