There are 2 columns containing the same kind of data:
col_a col_b ...
Bob Tim ..
John Frank .
Bob John
John Tim
Bob Bob
Frank John
Now the query I want to do is like 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 AWESOME.
Thanks again
1 Answer