0

I am trying to get data from a table that is identified by ID's from other tables; they all feed into each other. For example:

Get tblA.ID
Using tblA.ID, get tblB.ID
Using tblB.ID, get tblC.ID
Using tblC.ID, get tblD.Username

So I would begin with:

SELECT [ID]
FROM tblA
WHERE [Name] = 'Joe Bloggs'

But how would I continue the trail?

1

1 Answer 1

1
SELECT Username 
FROM tblD 
JOIN tblC ON tblC.ID = tblD.ID
JOIN tblB ON tblB.ID = tblC.ID
JOIN tblA ON tblA.ID = tblB.ID

Presumably you would use other columns joining each of the tables together, but this follows your example as closely as possible.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.