Skip to content
Advertisement

Tag: combinations

Oracle: how to get unique combinations of 2 sets

sample data: Data looks like group: 1 set: 1,2,3 I want to get all combinations of this 2 tables but UNIQUE ( 1,2,3 it’s same as 1,3,2), so output would be like this: I tried using connect_by_path, but it get’s me or same combinations (like 1-132) or some combinations are missing. Any ideas? Answer Assuming that you don’t have duplicated

SQL – find all combinations

From a dataset like this, I need to get all possible combinations of cases in the same room so that no case overlaps another. The expected result is I am able to get single line results of what case can be combined with which other case like: And I’ve tried some recursions but I am at a loss nowhere near

Advertisement