I need to obtain all elements m_id of Table A where m_active is = N and that the corresponding elements in Table B have ALL v_active = N.
m_id is foreign key in Table B.
In the example below, what I am looking for is m_id=2 and and m_id=4 as both satisfy the condition of being m_active=N and have ALL v_active = N.
How do I go about that?
Thanks
Table A example:
m_id m_active
1 Y
2 N
3 Y
4 N
Table B example:
v_id m_id v_active
1 1 N
2 1 Y
3 1 N
4 2 N
5 2 N
6 2 N
7 3 N
8 3 Y
9 3 Y
10 4 N