Suppose there are two tables which have 5 and 4 rows respectively and related by the column id. If you want to join these two tables and get data from table1 you can write old style join like below
create table table1 (id int, names varchar(100))
insert into table1
select 1,'test1' union all
select 2,'test2' union all
select 3,'test3' union all
select 4,'test4' union all
select 5,'test5'
create table table2 (id int, amount decimal(12,2))
insert into table2
select 1,87234.54 union all
select 2,491.90 union all
select 2,20000 union all
select 3,7000
select
t1.*
from
table1 as t1, table2 as t2
where t1.id=t2.id
The above returns 4 rows
But what happens when you forget to match the columns of the two tables?
select
t1.*
from
table1 as t1, table2 as t2
It produces 20 rows which is a cartesian product. But when you use ANSI stype join you will not get any unexpected result but an error. Consider these ANSI style syntaxes.
select
t1.*
from
table1 as t1 inner join table2 as t2
on t1.id=t2.id
While the above works the following will lead to error
select
t1.*
from
table1 as t1 inner join table2 as t2
So this is another reason why you should use ANSI joins