title: Thought process of CASE syntax in SQL
body: <p>I have the following code (I'm using northwind database) which give me the result shown in this <a href="https://i.stack.imgur.com/yFGMp.png" rel="nofollow noreferrer">picture</a></p>
  
  <pre><code>SELECT a.FirstName, a.TitleOfCourtesy, a.Notes, c.CustomerYear
  FROM employees a
      INNER JOIN orders b
      ON a.EmployeeID = b.EmployeeID
      LEFT JOIN customers c
      ON b.CustomerID = c.CustomerID
  WHERE a.TitleOfCourtesy = 'Ms.';
  </code></pre>
  
  <p>The code above combines three tables and selecting only rows with <code>a.TitleOfCourtesy = 'Ms.'</code> </p>
  
  <p>From the result I want to take the rows that has <code>%1992%</code> in the column <code>a.Notes</code> and only show rows that has the <code>c.CustomerYear</code> equal to 1992. So in the picture earlier I should only get the second top row visible.</p>
  
  <p>I thought I could use the CASE + WHEN syntax to create a kind of IF statement but I only get invalid use of syntax at the CASE line. Should the CASE part be moved after the WHERE part or do I use it completely wrong?</p>
  
  <pre><code>SELECT a.FirstName, a.TitleOfCourtesy, a.Notes, c.CustomerYear
  
  CASE 
      WHEN a.Notes LIKE '%1992%' THEN c.CustomerYear LIKE '1992' 
      ELSE NULL END 
  
  FROM employees a
      INNER JOIN orders b
      ON a.EmployeeID = b.EmployeeID
      LEFT JOIN customers c
      ON b.CustomerID = c.CustomerID
  WHERE a.TitleOfCourtesy = 'Ms.';
  </code></pre>
  
  <p>How should I think to achieve my desired result?</p>