There are 2 columns containing the same data type:
col_a col_b ...
Bob Tim ..
John Frank .
Bob John
John Tim
Bob Bob
Frank John
Now the query I want to do is similar to this (counting occurrences: (Bob, 3), (John, 2), ..):
SELECT col_a, count(*) AS total FROM table1 GROUP BY col_a
But instead of running it on col_a, I want to run it on col_a and col_b at the same time ((Bob, 4), (John, 4), ..)
Any help is appreciated.
edit: THANKS EVERYONE YOU ARE AMAZING.
Thanks again
source
share