Comparison Conditions Oracle Fusion Middleware Online Documentation Library

Conditions 6-3 Inequality test. query id=Q1[CDATA[ SELECT FROM S0 WHERE salary 2500 ]]query Greater-than and less-than tests. query id=Q1[CDATA[ SELECT FROM S0 WHERE salary 2500 ]]query query id=Q1[CDATA[ SELECT FROM S0 WHERE salary 2500 ]]query = = Greater-than-or-equal-to and less-than-or-equal-to tests. query id=Q1[CDATA[ SELECT FROM S0 WHERE salary = 2500 ]]query query id=Q1[CDATA[ SELECT FROM S0 WHERE salary = 2500 ]]query like Pattern matching tests on character data. For more information, see Section 6.4, LIKE Condition . query id=q291[CDATA[ select from SLk1 where first1 like Stev|phen ]]query is [not] null Null tests. For more information, see Section 6.6, Null Conditions . query id=Q1[CDATA[ SELECT last_name FROM S0 WHERE commission_pct IS NULL ]]query query id=Q2[CDATA[ SELECT last_name FROM S0 WHERE commission_pct IS NOT NULL ]]query [not] in Set and membership tests. For more information, see Section 6.8, IN Condition . query id=Q1[CDATA[ SELECT FROM S0 WHERE job_id NOT IN PU_CLERK,SH_CLERK ]]query view id=V1 schema=salary[CDATA[ SELECT salary FROM S0 WHERE department_id = 30 ]]view view id=V2 schema=salary[CDATA[ SELECT salary FROM S0 WHERE department_id = 20 ]]view query id=Q2[CDATA[ V1 IN V2 ]]query Table 6–2 Cont. Comparison Conditions Type of Condition Purpose Example 6-4 Oracle Complex Event Processing CQL Language Reference condition::= arith_expr::= on page 5-6, const_string::= on page 7-12, non_mt_arg_list::= on page 7-20, non_mt_arg_list_set::= on page 6-9, sfw_block::= on page 20-3

6.3 Logical Conditions

A logical condition combines the results of two component conditions to produce a single result based on them or to invert the result of a single condition. Table 6–3 lists logical conditions. Table 6–3 Logical Conditions Type of Condition Operation Examples NOT Returns TRUE if the following condition is FALSE. Returns FALSE if it is TRUE. If it is UNKNOWN, then it remains UNKNOWN. query id=Q1[CDATA[ SELECT FROM S0 WHERE NOT job_id IS NULL ]]query AND Returns TRUE if both component conditions are TRUE. Returns FALSE if either is FALSE. Otherwise returns UNKNOWN. query id=Q1[CDATA[ SELECT FROM S0 WHERE job_id = PU_CLERK AND dept_id = 30 ]]query OR Returns TRUE if either component condition is TRUE. Returns FALSE if both are FALSE. Otherwise returns UNKNOWN. query id=Q1[CDATA[ SELECT FROM S0 WHERE job_id = PU_CLERK OR department_id = 10 ]]query XOR Returns TRUE if either component condition is TRUE. Returns FALSE if both are FALSE. Otherwise returns UNKNOWN. query id=Q1[CDATA[ SELECT FROM S0 WHERE job_id = PU_CLERK XOR department_id = 10 ]]query Conditions 6-5 Table 6–4 shows the result of applying the NOT condition to an expression. Table 6–5 shows the results of combining the AND condition to two expressions. For example, in the WHERE clause of the following SELECT statement, the AND logical condition returns values only when both product.levelx is BRAND and v1.prodkey equals product.prodkey: view id=v2 schema=region, dollars, month_[CDATA[ select v1.region, v1.dollars, v1.month_ from v1, product where product.levelx = BRAND and v1.prodkey = product.prodkey ]]view Table 6–6 shows the results of applying OR to two expressions. For example, the following query returns the internal account identifier for RBK or RBR accounts with a risk of type 2: view id=ValidAccounts schema=ACCT_INTRL_ID[CDATA[ select ACCT_INTRL_ID from Acct where MANTAS_ACCT_BUS_TYPE_CD = RBK OR MANTAS_ACCT_BUS_TYPE_CD = RBR AND ACCT_EFCTV_RISK_NB = 2 ]]view Table 6–7 shows the results of applying XOR to two expressions. Table 6–4 NOT Truth Table -- TRUE FALSE UNKNOWN NOT FALSE TRUE UNKNOWN Table 6–5 AND Truth Table AND TRUE FALSE UNKNOWN TRUE TRUE FALSE UNKNOWN FALSE FALSE FALSE FALSE UNKNOWN UNKNOWN FALSE UNKNOWN Table 6–6 OR Truth Table OR TRUE FALSE UNKNOWN TRUE TRUE TRUE TRUE FALSE TRUE FALSE UNKNOWN UNKNOWN TRUE UNKNOWN UNKNOWN