Say I have the following tables:
Table 1
ColumnA ColumnB Outcome
Table 2
ColumnA ColumnB
Table 3
ColumnD ColumnE ColumnF Outcome
Table 4
ColumnD ColumnE ColumnF
Tables 1 and 3 are called by the session variable $Variable1 (so it will be one table or the other), and tables 2 and 4 by $Variable2 (again one or the other).
If I want a single query to select the Outcome from $Variable1, is there a way to say 'where the values in columns A and B are equal in both Tables 1 and 2, and where the values of the columns D, E, and F are equal in Tables 3 and 4.
I know there is a way to do this, i.e. 'where $Variable1.ColumnA = $Variable2.ColumnA etc. or $Variable1.ColumnD = $Variable2.ColumnD etc.
But i have a lot of tables like this, and want a way that simply says 'where the contents of $Variable1 (except outcome) = the contents of $Variable2.
Sorry if this is a bit confusing, but if anyone could help, I would be truly grateful.
Thanks, Sarah