title: Select on same table without subselect
body: <p>I have <strong>payment</strong>, <strong>period</strong> and <strong>event</strong> tables. For each employee, month and year, I want to return payment.value (SALARY) and payment.value (ADDITIONAL, like a bonus) on same row, depending of event number. The event number 10015 represent the ADDITIONAL, and event number 4986 represent the SALARY.</p>
  <p>I was able to reach my goal:</p>
  <pre><code>SELECT payment.employee_id EMPLOYEE_ID, payment.value SALARY,
  
  (SELECT payment.value ADDITIONAL FROM payment
      INNER JOIN period ON payment.period_id = period.id
      INNER JOIN event ON payment.event_id = event.id
  
      WHERE period.month = 7 
        AND period.year = 2021 
        AND payment.employee_id = 71
        AND event.number = 10015
  ) ADDITIONAL
  
  FROM payment
  
  INNER JOIN period ON payment.period_id = period.id
  INNER JOIN event ON payment.event_id = event.id
  
  WHERE period.month = 7 
      AND period.year = 2021 
      AND payment.employee_id = 71
      AND event.number = 4986
  </code></pre>
  <p>Result:</p>
  <p><a href="https://i.stack.imgur.com/fqk6t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fqk6t.png" alt="RESULT" /></a></p>
  <p>But now I'm trying to refactor my query so I don't have nested SELECTS. How can I do that?</p>