2016-04-08 41 views
0

OracleANY和ALL時沒有行返回

If a subquery returns zero rows, 
the condition [operator]ANY[subquery] evaluates to FALSE 
the condition [operator]ALL[subquery] evaluates to TRUE 

在其布爾邏輯或數學邏輯是基於它?

回答

1

沒有什麼不尋常 - 它只是實現了數學的所有並存運營商,其定義爲(通俗地說)

給定一組M和謂詞p,然後

All m elem M (p) 
<=> each element of M satisfies the predicate p 
<=> there's no element in M that doesn't satisfy p 

顯然,對於空集,這是真的,因爲它根本不包含任何元素。

給定一組M和謂詞p,則

Any m elem M (p) 
<=> there exists at least one element of M that satisfies the predicate p 
<=> for all elements of M, the inverse predicate !p is false 

顯然,這是假爲空集,因爲它不包含在任何的所有元件,因此不具有至少一個元件滿足謂詞。它還補充的所有(M)很好地定義,因爲

All(p) <=> !Any(!p) 

其中!表示邏輯逆NOT。

相關問題