-3

What is the difference between theese queries?

SELECT * FROM table1 AS t1, table2 AS t2 WHERE t1.id = t2.id;

SELECT * FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.id = td.id;

which is faster?

user3766478
  • 641
  • 2
  • 7
  • 16
  • possible duplicate of [INNER JOIN ON vs WHERE clause](http://stackoverflow.com/questions/1018822/inner-join-on-vs-where-clause) – AHiggins Dec 18 '14 at 13:49

1 Answers1

2

The first is the same as an inner join.

An inner join will get all rows from both tables that matches the condition.

A left join will get all rows from the left table and all rows that match the condition from the right table.

After the edit of the question they are both the same.

idstam
  • 2,848
  • 1
  • 21
  • 30