They are both technically equivalent, but if you're joining more than a couple tables (especially if they are large tables) and you're experiencing the query taking a long time to finish, it sometimes helps to control the plan order, which can be done with explicit joins (the second one, using INNER JOIN
s) and some tweaking of settings.
If you're using PostgreSQL, for example, you can set join_collapse_limit=1
to ensure that the query joins in the exact order you specify. This will only work when using explicit joins. Sometimes the plan does some weird, unexpected things that makes the query very slow, but if you know that your way would be faster and want to tell the planner to do it your way, you could specify that. Read this article about explicit joins in postgres for more information. Of course, this varies depending on what SQL you are using.