本文介绍了join sql查询中where和子句的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下两个 SQL 查询有什么区别
What is the difference between following two SQL queries
select a.id, a.name, a.country
from table a
left join table b on a.id = b.id
where a.name is not null
和
select a.id, a.name, a.country
from table a
left join table b on a.id = b.id and a.name is not null
推荐答案
基于以下两个测试结果
select a.id, a.name,a.country from table a left join table b
on a.id = b.id
where a.name is not null
更快(237 Vs 460).据我所知,这是一个标准.
is faster (237 Vs 460). As far as I know, it is a standard.
这篇关于join sql查询中where和子句的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!