Trying to select list not in the list of another list

Why does the IN() expression return N whereby, there are similar values in our Ref Table?

Please enlighten.

Solved Solved
0 10 1,833
1 ACCEPTED SOLUTION

If there are any duplicates within list1, @tonyโ€™s expression may erroneously suggest a difference, since list subtraction has the side-effect of removing duplicates.

For instance, if list1 is {1, 1, 1} and list2 is {2}, {1, 1, 1} - {2} will give {1}, the COUNT() of which is less than COUNT({1, 1, 1}) but does not reflect the occurrence of an item in list2.

To avoid:

COUNT(list1 - LIST()) > COUNT(list1 - list2)

View solution in original post

10 REPLIES 10
Top Labels in this Space