Hello everyone,
Small and (I think) very simple quesiton;-) which makes me creazy.
Let's say I have two tables listed below:
T1
====
IDX
====
1
3
4
T2
===============
IDD fk_IDX
===============
A 1
A 2
A 4
B 1
B 3
B 4
C 4
D 1
D 2
D 3
D 4
I would like to select from table T2 all distinct records IDD which
have all of fk_IDX containded in T1.
The select statement should return in this case ONLY:
B and D
becasue:
B has 1,3,4
and
D has 1,2,3,4 so it has this combination 1,3,4 contained in the T1
also.
I've tried to do that with group by, with having, in and it never
works (I always became all records which one of them is in this T1
table).
Maybe some one from you did try something like that, and can give a
fast answer.
I will be very greatfull
Greatings
Mateusz