0

Whats the difference between using On and Where keywords in a Sql query to check conditions.

select * from child_table inner join parent_table p on p.id>0;

select * from child_table inner join parent_table p where p.id>0;

Both these queries are providing me the same result

VijayIndia
  • 91
  • 1
  • 7
  • 1
    They are equivalent statements, but the first is correct SQL. The second only works in MySQL and looks like a bastardization of the language. `INNER JOIN` should always have an `ON` clause. – Gordon Linoff Oct 26 '15 at 01:02

1 Answers1

0

WHERE is a part of the SELECT query as a whole. And ON is a individual join.

See this Post.

Community
  • 1
  • 1
BRoebie
  • 374
  • 3
  • 13