Reputation: 263683
I wanted so much help from you guys :( ok, my problem is how to create a query that satifies my needs.. I have 3 Tables namely TableA(ColID, ColName, ColRec)
, TableB (ColRec, bID)
, and TableC(bID, xGrade, xTake, ColID)
.
Sample Record
When I search for the ColID
from TableA
I want to display all xGrade
from TableC
like this below:
but instead of above result I get this:
It also displays all records that matches bID
from TableB
and bID
from TableC
.
I can't finish my project without this query :( please help me guys..
Thanks in advance!
Upvotes: 0
Views: 90
Reputation: 2413
SELECT
A.ColID, B.bID, C.xGrade
FROM
TableA A
INNER JOIN
TableB B ON A.ColRec = B.ColRec
LEFT JOIN
TableC C on B.bID = C.bID AND A.ColID = C.ColID
WHERE
A.ColID = 1
will that work?
Upvotes: 3