I have 3 variables with some possible values. For example:
Var1 - possible values: 1,2,3
Var2 - possible values: a, b, c
var3 - possible values: false, true
Can you please help with an approach that returns all possible combinations?
The result be like:
1,a,false
1,a,true,
1,b,false
1,b,true,
1,c,false
1,c,true
2,a,false
2,a,true
2,b,false
Etc..
I wish the algorithm could apply to any levels of combinations, for example, the algorithm to work on 4 or 5 varibles with other possible values.
T-SQLwith few lines of codes, but not so easily inJavaScript.SELECT * FROM Var1,Var2,Var3. That was easy. :-) (sure wish they'd try a Golf contest for this kind of question.)