2023 May 29 7:54 AM
The documentation of the filter operator contains this note and does not elaborate or give examples.
The addition EXCEPT is not the same as a negation of the WHERE condition, particularly in the variant with a filter table.
Could someone please give an example where this is the case?
2023 May 29 10:27 AM
Hi Philip,
What I remind about EXCEPT is to be used on result sets, in fact I prefer the SQL which support MINUS operator, which make more sense to me and works in same way. See discussion:
https://blogs.sap.com/2014/07/31/an-introduction-to-hana-s-except-set-operator-function/
Also see a example:
https://blogs.sap.com/2017/10/04/calculation-view-intersect-and-minus-nodes/
Regards, Fernando Da Rós
2023 May 29 4:04 PM
If I understand well your answer, I think that the question is about FILTER and EXCEPT in ABAP, not about database/SQL.
2023 May 30 11:53 AM
2023 May 29 4:03 PM
The sentence "The addition EXCEPT is not the same as a negation of the WHERE condition, particularly in the variant with a filter table" is taken from here: ABAP Documentation - FILTER, Filter Operator (addition EXCEPT).
I don't understand too. According to me, the result is always the same, i.e.
itab = FILTER #( itab EXCEPT IN ftab WHERE c1 = f1 ).
would be equivalent to (this syntax is INVALID of course😞
itab = FILTER #( itab IN ftab WHERE NOT ( c1 = f1 ) ).
Let's see what people have to say...