title: Select two rows from MySQL database as one dependent on attribute
body: <p>I have FreeRADIUS that has a MySQL database backend. Users are stored in radcheck table:</p>
  
  <p><img src="https://i.stack.imgur.com/FoGOb.png" alt="radcheck table image"></p>
  
  <p>I want to select from it all users (there will be more users in the near future) with username, speed profile and password. So I will get as e result lukasfazik, testovacieheslo, OPTIK100.
  I have tried this:</p>
  
  <pre><code>SELECT  username, password, profile
  FROM (SELECT t1.username, t1.value AS password, t2.value AS profile
        FROM radcheck AS t1, radcheck AS t2
        WHERE t1.value != t2.value
       ) AS arrgh;
  </code></pre>
  
  <p>And I got this from it:</p>
  
  <p><img src="https://i.stack.imgur.com/Uk9ue.png" alt="result from my query image"></p>
  
  <p>GROUP BY doesn't work, I get an error:</p>
  
  <blockquote>
    <p>[42000][1055] Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'arrgh.password' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by</p>
  </blockquote>