第一种写法,因为两表where条件的一致,导致on关联时的条件相当于变成了a join b on 1=1,导致了笛卡儿积,数据量翻倍,故第一种写法时错误的
实验表二十万条数据
select date,id,name from a
join b on a.id=b.id
where a.date='2019-12-05' and b.date='2019-12-05'
select date,id,name from a
join b on a.id=b.id
where a.date='2019-12-05'` ---运行速度快
``