Product table contains tags columns:
create table product(
product char(20) primary key,
tag1 char(100),
tag2 char(100) )
tag columns contain tags separated by semicolon like
AB;AC;AD
RXX;AC;XAD
RP12;X455;R444;AXD
How to find all rows where tag1 and tag2 columns contain at least one same tag ?
For example row
tag1 tag2
AB;AC;AD RXX;ZAC;XAD;AC
should be in result since both columns contain AC
Row
tag1 tag2
AB;XAC;AD RXX;ZAC;XAD;AC
Should not be in result since all tags are different.
Using PostgreSQL 13.2