Here is what the source table looks like:
╔══════╦══════╦══════╗ ║ COL1 ║ COL2 ║ COL3 ║ ╠══════╬══════╬══════╣ ║ A ║ A ║ A ║ ║ A ║ A ║ B ║ ║ A ║ B ║ C ║ ║ B ║ B ║ C ║ ║ B ║ C ║ C ║ ║ C ║ C ║ C ║ ╚══════╩══════╩══════╝ I am looking to end up with results like this:
╔════════╦══════╦══════╦══════╗ ║ VALUES ║ COL1 ║ COL2 ║ COL3 ║ ╠════════╬══════╬══════╬══════╣ ║ A ║ 3 ║ 2 ║ 1 ║ ║ B ║ 2 ║ 2 ║ 1 ║ ║ C ║ 1 ║ 2 ║ 4 ║ ╚════════╩══════╩══════╩══════╝ I know this can be done unions, but my table has a large number of columns so I was hoping to find a more elegant solution.