I have following tables:
Table A
Aid, Cid, Jid
A1, C1, J1
A2, C1, J2
A3, C2, J1
A4, C2, J3
Table C[Cid, X] with Cid as foreign key in table A.
I want to get all the CIds from table A that contains both the Jids J1 and J2. For above table, I want to return C1 as the output. If I put an AND clause, I don't get any records and if I put an OR clause for the J column, I also get C2 in the output. Please assist.