You will find 2 posts that contains exactly the same type of data:

col_a  col_b ...
Bob    Tim   ..
John   Frank .
Bob    John
John   Tim
Bob    Bob
Frank  John

The query I wish to do is much like this (counting occurrences: (Bob, 3), (John,2), .. ):

SELECT col_a, count(*) AS total FROM table1 GROUP BY col_a

But rather than running it on col_a I wish to run it on col_a and col_b simultaneously ((Bob,4), (John, 4), ..)

Any assistance is appreciated

edit: THANKS Everybody You're AWESOME.

Many thanks

Select Z.name, Count(*) As Total
From    (
        Select col_a As name
        From total
        Union All
        Select col_b
        From total
        ) As Z
Group By Z.name
select Name, count(*) as Total
from (
    select col_a as Name from MyTable
    union all
    select col_b from MyTable
) a
group by Name

According to your Bob Bob column, I'd want to group on subqueries:

select idx, sum(count)
from (
    select col_a as idx, count(*) as count
    from table
    union all
    select col_b as idx, count(*) as count
    where col_a <> col_b -- avoid dups
    ) as counts
group by idx

or:

select idx, count(*)
from (
    select col_a as idx
    from table
    union all
    select col_b as idx
    where col_a <> col_b -- avoid dups
    ) as counts
group by idx