Using IN and NOT IN as a Set Operation Using IN and NOT IN as a Membership Condition

6-10 Oracle Complex Event Processing CQL Language Reference the query returns. In Q1, the non_mt_arg_list_set is 50,4,4,5. Note that each non_mt_arg_list that it contains matches the number and type of arguments in the non_mt_arg_list to the left of the condition, c1, c2. Example 6–1 S [range C on E] INTERVAL Value: Query query id=Q1[CDATA[ select c1,c2 from S0[range 1] where c1,c2 in 50,4,4,5 ]]query Example 6–2 S [range C on E] INTERVAL Value: Stream Input Timestamp Tuple 1000 50, 4 2000 30, 6 3000 , 5 4000 22, h 200000000 Example 6–3 S [range C on E] INTERVAL Value: Relation Output Timestamp Tuple Kind Tuple 1000: + 50,4 2000: - 50,4

6.8.3 NOT IN and Null Values

If any item in the list following a NOT IN operation evaluates to null, then all stream elements evaluate to FALSE or UNKNOWN, and no rows are returned. For example, the following statement returns c1 and c2 if c1 is neither 50 nor 30: query id=check_notin1[CDATA[ select c1,c2 from S0[range 1] where c1 not in 50, 30 ]]query However, the following statement returns no stream elements: query id=check_notin1[CDATA[ select c1,c2 from S0[range 1] where c1 not in 50, 30, NULL ]]query The preceding example returns no stream elements because the WHERE clause condition evaluates to: c1 = 50 AND c1 = 30 AND c1 = null Because the third condition compares c1 with a null, it results in an UNKNOWN, so the entire expression results in FALSE for stream elements with c1 equal to 50 or 30. This behavior can easily be overlooked, especially when the NOT IN operator references a view. Moreover, if a NOT IN condition references a view that returns no stream elements at all, then all stream elements will be returned, as shown in the following example. Since V1 returns no stream elements at all, Q1 will return view id=V1 schema=c1[CDATA[ IStreamselect from S1[range 10 slide 10] where 1=2 ]]view view id=V2 schema=c1[CDATA[ IStreamselect from S1[range 10 slide 10] where c1=2 Conditions 6-11 ]]view query id=Q1[CDATA[ V1 not in V2 ]]query