CRITERIAの基準は以下のとおりです:
TRUEまたはFALSEを評価する述語;- Criteria を組み合わせた論理的基準 (
AND,OR,NOT); - boolean 型の値式です。
使い方:
criteriaAND|ORcriteriaNOTcriteria(criteria)expression (=|<>|!=|<|>|<=|>=) (expression|((ANY|ALL|SOME) subquery))expression [NOT]ISNULLexpression [NOT]IN(expression[,expression]*)|subqueryexpression [NOT]LIKEpattern [ESCAPEchar]与えられた文字列パターンに文字列式をMATCHします。パターンには、
%を含めると任意の数の文字にマッチし、_を含めると任意の1文字にマッチします。エスケープ文字は、マッチ文字%および_をエスケープするために使用できます。expression [NOT] SIMILARTOpattern [ESCAPEchar]SIMILAR TOは と標準的な正規表現構文を掛け合わせたものです。 と は、それぞれ と ではなく、まだ使われています。LIKE%_.*.The CData Virtuality Server does not exhaustively validate
SIMILAR TOpattern values, but rather the pattern is converted to an equivalent regular expression. We recommend not to rely on general regular expression features when usingSIMILAR TO. If additional features are needed, useLIKE_REGEX. We do not recommend sing a non-literal pattern, as pushdown support is limited.expression [NOT] LIKE_REGEX patternLIKE_REGEXでは、マッチングに標準の正規表現構文を使うことができます。これはSIMILAR TOやLIKEと異なり、エスケープ文字が使われなくなります (\はすでに正規表現における標準的なエスケープ機構であり、%と_は特別な意味を持ちません)。詳細はjava.util.regex.Pattern クラスを参照してください。The CData Virtuality Server does not exhaustively validate
LIKE_REGEXpattern values. It is possible to use JRE only regular expression features that are not specified by the SQL specification. Additionally, not all sources support the same regular expression flavour or extensions. In pushdown situations, we recommend to ensure that the pattern used will have the same meaning in the CData Virtuality Server and across all applicable sources.EXISTS(subquery)expression [NOT]BETWEENminExpressionANDmaxExpressionCData Virtuality Server は
BETWEENをexpression >= minExpression AND expression <= maxExpressionと等価な形式に変換します。expressionこの場合、
expressionの型はbooleanとなり、以下の構文ルールが適用されます:NOT,AND,ORのように、優先順位の低いものから高いものへと比較します;- 括弧で入れ子にされたCriteriaは、親Criteriaを評価する前に論理的に評価されます。有効なCriteriaの例としては、以下のようなものがあります:
(balance > 2500.0)100*(50 - x)/(25 - y) > zconcat(areaCode,concat('-',phone)) LIKE '314%1';
- null 値は不明な値を表します。null 値との比較は'不明' と評価されます。
notが使用されている場合でも、TRUEになることはありません。