I have the following table of bitmasks (this is a fraction/sample of the actual table. The data I am working with has many more bitmask columns).
bm1 bm2 bm3
-------------------------
0 0 0
1 0 0
0 2 0
0 0 4
I would like to do a CROSS JOIN (of sorts) to list all possible combinations. But I would like the results to be in rows, not columns. Like this:
bm1 bm2 bm3
-------------------------
0 0 0
0 2 0
0 0 4
1 0 0
1 2 0
1 0 4
0 2 4
1 2 4
The order of the columnar data must persist. i.e. bm1 can only be a 0 or 1, bm2 can only be 0 or 2, and bm3 can only be 0 or 4, etc.
Also, I am not committed to the original table of bitmasks. If there is a better approach to produce the desired resulting data, I am open to it.
How can this be accomplished?
Thank you!