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) :
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.