I have three simple DB tables and I'm trying to do a couple queries which should be simple but I seem to be getting stuck.
First I have 2 Tables with 3 columns in them.
TABLE1 with Col1, Col2 and Col3
TABLE2 with Col1, Col2 and Col3
I want to know if any data in TABLE1.Col1 matches TABLE2.Col1 and if so I want to produce a list.
Next TABLE1 and TABLE2 list qty of units. TABLE3 list other information such as descriptions. So I need to look at TABLE3.Col4 match it to either TABLE1.col1 or TABLE2.col1 and check TABLE1.Col2 and/or TABLE2.Col2 to determine if there is more than X available. If there is more than X available than I need to get all data from TABLE3 and the Col2 data from TABLE1 or TABLE2.