How do I get specific records with FromSqlRaw and left Join?

Viewed 28

I have this query:

var tl = _context.Torneos.FromSqlRaw(@"
SELECT Torneos.*
FROM Torneos
LEFT JOIN Clasificados ON Torneos.TorneoID = Clasificados.TorneoID
WHERE Clasificados.TorneoID IS NOT NULL");

where Torneos and Clasificados are two tables.

The problem is that I get all records from Torneos not just the ones that have corresponding entries in Clasificados

0 Answers
Related