The mystery of how Sqlserver operates internally is difficult to solve.
It is quite possible that in some cases the difference is only in syntax and Sql Server operates in the same way.
But the subquery, theoretically, would have to be executed on each record of the main query while the Join table would be treated differently. Which makes me think Join is more performance-oriented. But, according to the link below, there is no difference in performance when the queries are equivalent. (As in the case of your example)
See in: http://technet.microsoft.com/en-us/library/ms189575(v=sql.105). aspx
When the consultations are equivalent there is no difference in performance. But when the condition of existence (EXISTS) has to be checked with each record of the main query, Join has better performance.
In your case, an error may occur if the subquery returns more than one record. Unless you use "IN"
SELECT funcionarios.nome
FROM funcionarios
WHERE empresa_id IN ( SELECT id
FROM empresas
WHERE nome = 'Nome da Empresa' )
In a large and complex query, subquery may make the query more difficult to read. But it is indispensable in other cases.
I only use subquery when the thing cannot be done with Join.
In general Join will be faster , "IN" has the advantage of making the idea clear , but nothing that a comment does not solve.
– Motta