I've been wrestling with this for a few hours and I'm hoping you can give me some fresh insight. I have 6 tables as follows:
Table D, which is a another child of A (one-to-many)
Table E is another parent of D, in a one-to-[zero-or-one] relationship
Basically I need to select a field from B where C = F.
I have tried with subqueries, joins, and a combination of both, but have not got too far. Any ideas would be appreciated.
With the information you've presented, how about
SELECT *
FROM A
INNER JOIN B ON B.AID = A.AID
INNER JOIN C ON C.BID = B.BID
INNER JOIN D ON D.AID = A.AID
INNER JOIN E ON E.DID = D.DID
INNER JOIN F ON F.EID = E.EID
WHERE C.Field = F.Field
If this is not what you need, you might want to post a small subset of data with the required results.
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.