title: What's the resolving order of operators in where-conditions in MySQL (example: SELF join)
body: <p>I was looking into some SQL-tutorials and found an example that makes me scratch my head. I don't wanna copy all of the <code>SELF</code> join example, given there, so I will post the link to the relevant page <a href="http://www.tutorialspoint.com/sql/sql-self-joins.htm" rel="nofollow">here</a>.<br>
  In that example a <code>SELF</code> join is made on a "customer" table that contains the salary. The <code>WHERE</code>-condition is <code>a.SALARY &lt; b.SALARY</code>. I assumed that the "lesser than"-operator would be left-associative. Meaning, I expected that the engine would take each row of <code>table a</code> and join it with the respective rows of <code>table b</code>, that match the <code>WHERE</code>-condition.<br>
  So I would get the following result:</p>
  
  <pre><code>+----+----------+---------+
  | ID | NAME     | SALARY  |
  +----+----------+---------+
  |  1 | Chaitali | 2000.00 |
  |  1 | Hardik   | 2000.00 |
  |  1 | Komal    | 2000.00 |
  |  1 | Muffy    | 2000.00 |
  |  2 | Ramesh   | 1500.00 |
  |  2 | kaushik  | 1500.00 |
  |  2 | Chaitali | 1500.00 |
  |  2 | Hardik   | 1500.00 |
  |  2 | Komal    | 1500.00 |
  |  2 | Muffy    | 1500.00 |
  |  3 | Chaitali | 2000.00 |
  |  3 | Hardik   | 2000.00 |
  |  3 | Komal    | 2000.00 |
  |  3 | Muffy    | 2000.00 |
  |  4 | Hardik   | 6500.00 |
  |  4 | Muffy    | 6500.00 |
  |  5 | Muffy    | 8500.00 |
  |  6 | Chaitali | 4500.00 |
  |  6 | Hardik   | 4500.00 |
  |  6 | Muffy    | 4500.00 |
  +----+----------+---------+
  </code></pre>
  
  <p>My problem is that the author says the MySQL-output (see: <a href="http://www.tutorialspoint.com/sql/sql-syntax.htm" rel="nofollow">"the authors statement about using MySQL for testing example-code"</a>) would be the following:</p>
  
  <pre><code>+----+----------+---------+
  | ID | NAME     | SALARY  |
  +----+----------+---------+
  |  2 | Ramesh   | 1500.00 |
  |  2 | kaushik  | 1500.00 |
  |  1 | Chaitali | 2000.00 |
  |  2 | Chaitali | 1500.00 |
  |  3 | Chaitali | 2000.00 |
  |  6 | Chaitali | 4500.00 |
  |  1 | Hardik   | 2000.00 |
  |  2 | Hardik   | 1500.00 |
  |  3 | Hardik   | 2000.00 |
  |  4 | Hardik   | 6500.00 |
  |  6 | Hardik   | 4500.00 |
  |  1 | Komal    | 2000.00 |
  |  2 | Komal    | 1500.00 |
  |  3 | Komal    | 2000.00 |
  |  1 | Muffy    | 2000.00 |
  |  2 | Muffy    | 1500.00 |
  |  3 | Muffy    | 2000.00 |
  |  4 | Muffy    | 6500.00 |
  |  5 | Muffy    | 8500.00 |
  |  6 | Muffy    | 4500.00 |
  +----+----------+---------+
  </code></pre>
  
  <p>which indicates that the engine takes rows from <code>table b</code> first and compares them to <code>table a</code>.<br>
  I don't know now if this is the authors fault, because he forgot to mention any <code>ORDER BY</code> or <code>GROUP BY</code> arguments. (In that case that tutorial just s*cks.)</p>
  
  <p>But if the output he stated is actually correct on MySQL-Server, I would like to know from people who know much more about SQL than me,<br>
  a) why this operator resolves from right to left and<br>
  b) what reasons there are to do so. Is it a performance issue? Or was I wrong about the "lesser than"-operator right from the bginning: that it never takes the left operand first?<br>
  c) I would like to know if this is just the result of MySQL or an issue related to SQL in general.</p>
  
  <p>Unfortunately, I can't test this output by myself because I currently don't own any computer I'm allowed to install MySQL on. So your help would be much appreciated : )<br>
  I hope this question doesn't sound too stupid but I couldn't find helpful sources on the internet that specifically explain this behaviour. When I studied I had two modules about RDBMS and in all the examples operators were always resolved the way I did it in the first output-example above. That's why I'm currently confused about this ^^</p>
  
  <p>Thanks in advance for wasting your time for me :D
  best regards.</p>