title: MySQL: how do I do in inline function with ORDER BY?
body: <p>So, I want to create a formula for ordering things by popularity, but I don't want to create a stored procedure or function. I'd like the function just to be in my query.</p>
  
  <p>So, is there a way to do something like</p>
  
  <pre><code>SELECT cols
  FROM tables
  WHERE conditions
  ORDER BY function(){ logic using cols } DESC LIMIT 10
  </code></pre>
  
  <p>or something like that?</p>