Blatt 3, Aufgabe 2e: select * from country c where not exists (select * from organization o where ('AND',o.abbreviation) in (select country,organization from ismember) and (c.code,o.abbreviation) not in (select country,organization from ismember)) ### oracle 12: 244 ergebnisse ### oracle 11: 22 ergebnisse ### postgres: 22 ergebnisse Der Query Plan in Oracle 12 ist schon verraeterisch (ignoriert die Subquery komplett): Query Plan: Operation COST BYTES Rows TIME SELECT STATEMENT 3 11224 244 1 _TABLE ACCESS (FULL) COUNTRY 3 11224 244 1 ... die aequivalent umgeschriebene Anfrage liefert das korrekte Ergebnis: select * from country c where not exists (select * from organization o where ('AND',o.abbreviation) in (select country,organization from ismember) and not exists (select * from ismember where country=c.code and organization=o.abbreviation)) ## 22 Ergebnisse ... traue nie einer Datenbank.