title: Usage of single quotes in SQL queries
body: <p>I have the following SQL query:</p>
  
  <pre><code>SELECT id_zam AS test, 
       CASE WHEN (SELECT something FROM sth WHERE id_something = test) = 1 
            THEN 
                'true' 
            ELSE 
                'false'  
       END as test_result
  FROM testTable
  </code></pre>
  
  <p><code>something</code> equals 1. So the CASE statement is TRUE so it's going to execute <code>THEN</code> statement which is <code>'true'</code></p>
  
  <p>But when I add single quotes around the alias <code>test</code> like this:</p>
  
  <pre><code>SELECT id_zam AS 'test', 
       CASE WHEN (SELECT something FROM sth WHERE id_something = 'test') = 1 
            THEN 
                'true' 
            ELSE 
                'false'  
       END as test_result
  FROM testTable
  </code></pre>
  
  <p>The query returns <code>'false'</code>. Can anyone explain why they're different?</p>