>Maybe this is the question I should have asked:
>
>Table company has a comp_code column - a primary key and a comp_group column
>comp_group can be blank or it can contain the key to itself or another row in the table.
>
>How can I find all the members of the group that @comp_code belongs to?
This is still not very clear. Can you post a sample input and desired output? Are you looking for recursive cte?
If it's not broken, fix it until it is.
My Blog