title: SQL: ORDER BY two columns intermixed, not priority based
body: <p>I'm using mySQL. I have to order names of Contacts by Lastname but in the case that there is no last name, I order by firstname.</p>
  
  <p>This looks like:</p>
  
  <pre><code>ORDER BY lastname = "", lastname, firstname
  </code></pre>
  
  <p>However, this makes the ones with lastnames appear at the top. The behaviour I'd like is to intermix the first and lastnames like they were from the same field.</p>
  
  <p>Example (pretend these are names):</p>
  
  <pre><code>A,T 
  Z,G 
  A 
  B 
  C
  </code></pre>
  
  <p>Versus:</p>
  
  <pre><code>A
  A,T
  B
  C
  Z,G
  </code></pre>
  
  <p>Thanks</p>