'lo
Consider this:
Table A
- ID
- Name
Table B
- ID
- AID (FK for A.ID)
- Name
Table C
- ID
- BID (FK for B.ID)
- Name
I'm wanting to return rows from Table C. No problem:
SELECT C.* FROM C WHERE C.ID = @ID
I'm also wanting to return the B.Name for the FK B.ID; again, no problem:
SELECT C.*, B.Name FROM C, B WHERE C.ID = @ID AND B.ID = C.BID
I'm also wanting to return A.Name for the FK B.AID... problem:
How the heck do I do that?
I'm wanting the returned table to have these fields:
C.ID | C.BID | C.Name | B.Name | B.AID | A.Name
So... how? 