Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

To check ALL condition in Teradata - forum topic by pavan.polish

$
0
0

Hi All,
I have a below requirement:-
Table1:-
GROUP_ID - MEMBER_ID
A - A
A - B
A - C
M - M
M - N
M - O
X - X
X - Y
X - Z
Table2:-
MEMBER_ID - MEMBER_FLAG
A - Y
B - Y
C - Y
M - Y
N - ?
O - Y
X - N
Y - N
Z - Y
I want to select groups from Table1 whose all members have MEMBER_FLAG as "Y" in Table2.
The expected output is:-
GROUP_ID - MEMBER_ID
A - A
A - B
A - C
The groups M and X should not come in the output as members have different flags in Table2.
Could you please advise.
Thanks a lot in advance.
Regards,
Sagar

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>