Загрузка данных


select
    a.code_1c,
    count(*) as cnt
from ourpension.agent a
where a.code_1c is not null
  and btrim(a.code_1c) <> ''
group by a.code_1c
having count(*) > 1
order by cnt desc, a.code_1c;