What's the difference between comma separated joins and join on syntax in MySQL?

Big Money picture Big Money · Nov 22, 2013 · Viewed 84.6k times · Source

For example if I were to have a table "Person" with a column "id" that references a column "id" in table "Worker"

What would the difference between these two queries be? They yield the same results.

SELECT * 
FROM Person 
JOIN Worker 
  ON Person.id = Worker.id;

and

SELECT * 
FROM Person, 
     Worker 
WHERE Person.id = Worker.id;

Thanks

Answer

Sateesh Pagolu picture Sateesh Pagolu · Nov 22, 2013

There is no difference at all.

First representation makes query more readable and makes it look very clear as to which join corresponds to which condition.