I have two tables tabData and tabDataDetail.
I want all idData(PK) from Parent-Table(tabData) that have only rows in Child-Table(tabDataDetail, FK is fiData) with:
- fiActionCode=11 alone
or - fiactionCode=11 and fiActionCode=34
Any other combination is invalid. How to get them?
What i’ve tried without success(slow and gives me also rows that have only fiActioncode 34) :

(source: bilder-hochladen.net)
Thanks for your Time.
EDIT: Thanks to all for their answers. Now i unfortunately have not enough time to check which one is best or works at all. I marked the first working one as answer.
EDIT2: i think that the marked answer is really the most efficient and compact solution.
EDIT3: Codesleuth’s answer is interesting because it returns only rows than have only a single fiActionCode=11. Difficult to see, because that its only true for 20 tabDataDetail-rows ot of 41524189 total-rows that have two. Anyway that was not 100% what i’ve asked or rather what i was looking for.
To expand on my logic, the first check (a correction) is to ensure that a row with fiActionCode = 11 exists. The second check works by first defining the set of rows we do not want. We do not want anything that is something other than fiActionCode = 11 or 34. Because that is the set of items we do not want, we search for anything that does not exist in that set.