title: Pivoting a table with SQL
body: <p>I have a table with position (junior, senior), salary, and an ID. I have done the following to find the highest salary for each position.</p>
  <p><code>SELECT position, MAX(salary) FROM candidates GROUP BY position;</code></p>
  <p>What I am getting:
  <a href="https://i.stack.imgur.com/EgZJK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EgZJK.png" alt="enter image description here" /></a></p>
  <p>How I want it:
  <a href="https://i.stack.imgur.com/FBN9n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FBN9n.png" alt="enter image description here" /></a></p>
  <p>I want to transpose the outcome so that 'junior' and 'senior' are the columns without using crosstab. I have looked at many pivot examples but they are done on examples much more complex than mine.</p>