-1

If I use syntax like this

SELECT * FROM table_1, table_2 WHERE table_1.id=table_2.id;

is this an INNER JOIN? In other words, is this equivalent to

SELECT * FROM table_1 INNER JOIN table_2 ON table_1.id=table_2.id;
Bill
  • 4,323
  • 8
  • 28
  • 32

2 Answers2

2

Short answer: Yes, it is the same.

Most RDBMS will eventually process both syntax the same way.

Using the INNER JOIN is considered to be better readable, and also is the ANSI standard.

Bjoern
  • 15,934
  • 4
  • 43
  • 48
1

For simple cases like this, it appears that the MySQL engine will optimize in the same way. I figured this out by running

DESCRIBE SELECT * FROM table_1, table_2 WHERE table_1.id=table_2.id;

and

DESCRIBE SELECT * FROM table_1 INNER JOIN table_2 ON table_1.id=table_2.id;

which tells you a bit about how the query will run.

Vyassa Baratham
  • 1,457
  • 12
  • 18