I am trying to run the following MS Access query using values from the first select into the second: (This question originated from here Using results from a query within the same query but I changed it up greatly and I feel it warrants a new question)
SELECT
A.field1,
A.field2,
A.field3,
FROM TheTable AS A
Where A.Id = 3;
?Join / UNION?
SELECT
B.field4,
B.field5
FROM TheTable AS B
Where B.Id = field1
In the end, I'd like the there to be 5 columns as output based on these two queries, but how can I do the joins/unions correctly for this? Note that TheTable
is the same in both queries but I am using it differently in each part...
I wouldn't mine having a first row of 3 elements the next row of 2 columns (and a null). As long as I can get it done in one query.
So the output would look like:
A.field1, A.field2, A.field3, B.field4, B.field5
1, 2, 3, 4, 5
etc.