Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Find Possible Combinations

$
0
0

We are trying to automate the sequence of our order picking process.  Our order picking is based on "lifts", where the max height of a lift is 18 inches.

On our item lines we know the height in inches and our goal is to find all possible combinations of grouping the item lines together where they do not go above 18 inches.

The example below is what we're trying to accomplish - it has 5 line items , and we've been able to manually find 6 different possible valid combinations.

Generally the no of lines range from 5 to 30

Any suggestions on a good way to produce this in SQL?

Line NoItem No.InchesOption 1Option 2Option 3Option 4Option 5Option 6
1Item 1        18.00 Lift 1 Lift 1 Lift 1Lift 1 Lift 1 Lift 1
2Item 2        13.00 Lift 2 Lift 2 Lift 2Lift 2 Lift 2 Lift 2
3Item 3        10.00 Lift 3 Lift 3 Lift 3Lift 3 Lift 3 Lift 3
4Item 4          3.00 Lift 2 Lift 2 Lift 3Lift 3 Lift 4 Lift 4
5Item 5          2.00 Lift 2 Lift 3 Lift 3Lift 4 Lift 4 Lift 5



Viewing all articles
Browse latest Browse all 23857

Trending Articles