Is there a way to combine the following queries Q1 and Q2 into one?
I believe it to be important to know the structure of the tables a, b & c:
All b.01 values will be present in a.01.
This is Q1:
SELECT a.ID, b.[02], b.[01]
FROM a, b
WHERE (((b.[01])=[a].[01]));
This is Q2:
SELECT Q1.*
FROM Q1 LEFT JOIN c ON [Q1].[ID]=[c].[01]
WHERE ((c.[02]) Is Null);
Something like this might work:
SELECT a.ID, b.[02], b.[01]
FROM a INNER JOIN b ON b.[01] = a.[01]
LEFT JOIN c ON a.id = c.[01]
WHERE c.[02] IS NULL
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.