I currently need to write a dynamic SQL query because I need to pivot a
column based on the distinct values that appear in a given column (and I
do not want to manually specify which of these values I want pivoted as
there are many). I tried writing ...