I have a list of elements. For this, let's say they are Fire, Water, Earth, and Air. Each of these elements can be combined in a way such that the *may* react and will produce something new. This is inclusive, or it includes repeats. So Air + Air = Wind, for example, and Air + Earth = Dust, and so forth.
So I have a table called 'Elements', and I have two columns in the table, an ID which is the Primary Key, and ElementName, which is unique. I suppose I could just use the ElementName as the primary key, but whatever.
I want to be able to generate a list of reactions to test. As I test them I'll update another table with the results of the reactions. If a reaction produces a new element, I'll add that to the 'Elements' table, and generate a new list of reactions to test.
I hope this makes sense so far!
So I generated three queries, two of them did a SELECT DISTINCT from the original table to produce a list of all unique elements, and the third query performed a query on the first two:
[tt]Query3
SELECT *
FROM Query1, Query2
WHERE (((Query1.ElementName)<>[Query2].[ElementName]));[/tt]
But this produces a table of 12 reactions to try. The reason is because it gives me Air + Water as a reaction, and Water + Air as a reaction. In this case, this is the same reaction and need not be repeated.
So I know I'm totally doing this wrong. There must be an easier way to do this.
I originally looked at this as a math problem and found this information on Wikipedia: The query should produce a set of 10 reactions to try, 10 combinations, from the original 4 elements.
I know a bit about queries but it's been a long time since I had a project like this, so don't assume I know too much!
Thank you for your help!!
Thanks!!
Matt
So I have a table called 'Elements', and I have two columns in the table, an ID which is the Primary Key, and ElementName, which is unique. I suppose I could just use the ElementName as the primary key, but whatever.
I want to be able to generate a list of reactions to test. As I test them I'll update another table with the results of the reactions. If a reaction produces a new element, I'll add that to the 'Elements' table, and generate a new list of reactions to test.
I hope this makes sense so far!
So I generated three queries, two of them did a SELECT DISTINCT from the original table to produce a list of all unique elements, and the third query performed a query on the first two:
[tt]Query3
SELECT *
FROM Query1, Query2
WHERE (((Query1.ElementName)<>[Query2].[ElementName]));[/tt]
But this produces a table of 12 reactions to try. The reason is because it gives me Air + Water as a reaction, and Water + Air as a reaction. In this case, this is the same reaction and need not be repeated.
So I know I'm totally doing this wrong. There must be an easier way to do this.
I originally looked at this as a math problem and found this information on Wikipedia: The query should produce a set of 10 reactions to try, 10 combinations, from the original 4 elements.
I know a bit about queries but it's been a long time since I had a project like this, so don't assume I know too much!
Thank you for your help!!
Thanks!!
Matt