Check this query:
;
with U as
(
select ComplaintID_1 as C
FROM #Temp
union
select ComplaintID_2
FROM #Temp
),
V as
(
select C, case
when a > 0 and b > 0 then substring(C, a, b - a)
when a > 0 then substring(C, a, len(C) - a + 1)
else C end as s,
a, b
FROM U
cross apply (values (charindex('.', C), charindex('(', C))) t(a,b)
)
select
count( distinct s) as [NumOf Unique Complaints],
count( case s when '.123' then s end) as [# Of .123 Occurences],
count( case s when '.999' then s end) as [# Of .999 Occurences],
count( case s when '.123' then null when '.999' then null else s end) as [# Of Other Occurences]
from V
It is not clear if you want to group the counts by C_GUID.