Skip to content
Advertisement

Find items in table with 2 specific sizes

I have items table where the item code repeats as it has different sizes, variants.

I want to find items which has 2 specific sizes, ie size in both M/Y and Euro.

Items table:

Required, I want to query for item id 1 and 3.

I was trying with SUM(), CASE but not able to figure it as it involves LIKE operator. (Size like '[^EU]%' and Size like 'EU%')

#Update:

With little hint, I could do it with 2 queries using temp table. Would be nice to see it in single query.

1st Query.

2nd Query.

Thanks.

Advertisement

Answer

I think you wanted Id with both EU% and non EU%

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