I’m trying to construct a SQL query that I think requires multiple JOIN’s, but I don’t know the syntax.
Here is a rough example of the Tables (with column names) for each.
T1 (key, name)
T2 (key, fkeyT1)
T3 (key, fkeyT2)
I want to get all the rows from T3 that are linked to rows in T2 that are linked to rows in T1 with a given name.
I figure I’ll need at least 2 JOIN’s; I’ve got the first JOIN I think:
SELECT *
FROM T3 INNER JOIN T2
ON T3.fkeyT2 = T2.key
I figure I’ll need to take these results and do another JOIN with T1 but I’m not sure of the syntax.
You probably want something like