February 16, 2011 at 8:10 am
I have a working knowledge of SQL, but my programming skills are lacking. I've searched a number of posts, but have not been able to find exactly what I need.
I'm looking to find all possible combinations of values in a list, and I would like to store them in a table. The values are dynamic so I would prefer to have the orginals stored in a table instead of in the code. For simplicity, say I have the two values A and B. The way I would want to store the combinations would be:
Table1 Table2 Table 3
Value Value Value
A B A
B
I'm not planning on storing all the tables, but comparing the values associated with them and choosing one of them, e.g. table1 vs table3, choose table3 (I have something to do that already). Any help on this is appreciated.
February 16, 2011 at 8:17 am
Can you please be more specific on your requirement ? I am unable to figure it from your initial post.. This (all possible combination) seems doable with CROSS JOINS , but i need still more data to confirm..
February 16, 2011 at 8:40 am
Thanks for the quick response.
Essentially, I want to create a table that contains all the possible combinations for list of values in another table. However, unlike most of the examples I have seen, I do not want to string these together but append them.
February 16, 2011 at 10:20 am
I would lean towards a cross join of the tables, but again, your description doesn't make sense. What's "all the combinations" and what's "append" mean?
you'll have to provide a good sample of data and results to explain this.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply