SQL Language (MOSC)

MOSC Banner

Map a CSV string with ID in an association table (many to many)

DB-version: 21.11 EE

-- Problem --

I have a comma separated string. The string consists of label_ids in a random order (unsorted). I need to map that string with a association table with one row per member of the group, all sharing the same group_id.

-- Desired outcome --

I want vu_raw.id = 9249824020 to map to the highest label_group_id that matches all off the label_id:s in the csv-string. In this case the correct answer would be labels_in_group.label_group_id = 213914. There are multiple label_group_id:s that match all of the label_id:s and label_group_id = 182581 matches all it is disqualified for having one extra member. My biggest issue is with label_group_id = 313914 as it also contains one extra member, i.e. matches 6 out of 6 but it also has a seventh member AND it har a higher label_group_id than the correct answer (213914). 

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center