Good Afternoon Jakub.
My earlier proposal on the query text (select distinct persid,sym as ctg_l1 from prob_ctg where del = 0 and ss_sym not like '%.%') appeared to work for you, right?
That's why I did that 'mark as correct'.
Please open another thread (or possibly, better a standard case?) for the 'other' issue you described.
This to keep each and every 'issue' you want to be worked on, as clear and as clean as possible.
And thus avoiding any confusion for every one, joining this community thread.
Thanks in advance for your understanding and kind regards, Louis.