title: Convert Excel 'if' function to SQL query
body: <p>I have a function like this:</p>
  
  <p><code>if(a&gt;b,if(b&gt;c,a,b),c)</code></p>
  
  <p>This follows the syntax <code>if(condition,true,false)</code>. I was looking for a way to convert this into an SQL query like so:</p>
  
  <pre><code>select case 
    when a&gt;b then 
       case 
            when b&gt;c then a 
            else b 
       end 
    else c 
  end
  </code></pre>
  
  <p>I thought of splitting the input and passing it on my own, but I was hoping there was a better way to do this.
  Any help is appreciated!
  Thanks in advance.</p>