-4

I use this following query ,it works fine,but i have doubt about why we use 'ON' in this

select * from test_table 
left outer join  test_table_1 on  test_table.id = test_table_1.ref_id
Andrew
  • 26,629
  • 5
  • 63
  • 86
cvas
  • 31
  • 1
  • 4

2 Answers2

0

There shouldnt be any doubt, 'on' is the syntax used to express the join predicate.

Andrew
  • 26,629
  • 5
  • 63
  • 86
0

ON clause describe the relation between those two tables. This is the base of the join (on which fieldd you want to join the tables.)

For more refer MySQL JOIN Syntax.

Himanshu
  • 31,810
  • 31
  • 111
  • 133