Postgresql – Pivoting a table with SQL
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. SELECT position, MAX(salary) FROM candidates GROUP BY position; What I am getting: How I want…