Skip to content
Advertisement

Can I use string_split with enforcing combination of labels?

So I have the following table:

I want to use string_split function to identify rows that have both bike and motorbike labels. So the desired output in my example will be just the first row:

Currently, I am using the following query but it is returning row 1,2 and 3. I only want the first. Is it possible?

Advertisement

Answer

You can use APPLY & do aggregation :

However, this breaks the normalization rules you should have separate table tickets.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement