I have a varchar column like 'a,b,c,d,cd,cx,bx'. This has comma for separating some prefix code and I want to search c prefix in this column. Column name is prefix.
When we use IN operator:
select * from prefixes where 'c' IN (prefix)
it does work but how? I know that prefix must 'a', 'b', 'c', 'd', 'cd', 'cx', 'bx' for work to IN operator like:
select * from prefixes where 'c' IN ('a', 'b', 'c', 'd', 'cd', 'cx', 'bx')
Am I wrong? And how can it work? Commas are not separator. Those are in string like prefix.