When you have a query where you're joining from a non-null foreign key to the foreign table it doesn't matter if you use
LEFT JOIN or
INNER JOIN from a result standpoint (since there won't be any cases where it doesn't match something on the right). In a case like this which should be preferred,
INNER JOIN or
LEFT JOIN. I'd like to consider performance as well as style/documentation.
To me the
INNER JOIN is closer to what you want, since the special characteristic of the
LEFT JOIN doesn't happen, but in a lot of places I see
LEFT JOIN just being the default unless
INNER JOIN is explicitly needed so I'm partially worried that it may cause people to double think something that doesn't need thinking.
e.g. which of the following should be preferred
FROM dbo.Post p LEFT JOIN dbo.User u ON p.UserID = u.UserID
FROM dbo.Post p INNER JOIN dbo.User u ON p.UserID = u.UserID
assuming that UserID is a foreign key to the user table and no post can be created without a user