It depends on the size of the tables, the available indexes, and the power of these indexes.
If you do not get the same execution plan for both queries, and if none of the query plans executes a JOIN instead of a sub query, I would suggest that the second version is faster. The first version is correlated and, therefore, will create many more subqueries, the second version can be satisfied with three sums of requests.
(Also, note that different engines can be biased in one or the other direction. Some engines can correctly determine that the requests are the same (if they are actually the same) and allow the same execution plan.)
Larry lustig
source share