|
1
35
|
|
|
2
13
检查空字符串和空字符串。 |
|
|
3
2
就性能而言,这取决于。
|
|
|
4
1
Well I can see them using this because this way if the name doesn't match or is null it returns as a failed comparison. This really means:
这个在哪
|
|
|
5
1
他们的意思不一样。
这将检查名称字段为空的记录
This one changes the value of null fields to the empty string so they can be used in a comparision. In SQL Server (but not in Oracle I think), if a value is null and it is used to compare equlaity or inequality it will not be considered becasue null means I don't know the value and thus is not an actual value. So if you want to make sure the null records are considered when doing the comparision, you need ISNULL or COALESCE(which is the ASCII STANDARD term to use as ISNULL doen't work in all databases). 你应该看到的是
a.名称<gt;b.名称 然后您将了解为什么需要IsNull来获得正确的结果。 |
|
|
6
1
我显然误解了你的问题。所以让我先回答我的第一个问题,然后试试这个问题:
是一个误入歧途的捷径
|
|
|
7
1
Others have pointed out the functional difference. As to the performance issue, in Postgres I've found that -- oh, I should mention that Postgres has a function "coalesce" that is the equivalent of the "isnull" found in some other SQL dialects -- but in Postgres, saying
明显快于
而且,说起来可能会快得惊人。
结束
大于测试可以使用索引,从而跳过所有空白,而不相等的测试必须进行完整的文件读取。(假设您在字段上有一个索引,并且没有使用其他索引。) |
|
|
8
0
另外,如果要使用该列的索引,请使用
|
|
|
9
0
这两个查询不同。例如,我没有中间名,这是一个已知事实,可以存储为
但是,如果我们不知道某人的中间名,我们可以存储空值。 因此,isnull(中间名,“)是指“没有已知中间名的人”。 |
|
|
10
0
它处理空字符串和
|