December 9th, 2012, 01:18 AM
Matching Query Results inside another Query Results
SELECT AID FROM TABLEA WHERE A1 = 1;
SELECT B.BID, A.AID FROM AID A, BID B WHERE A.AID = B.BID AND A1 = 1;
The first code above will give a list. (Ex. 1,2,3,6) I need to know if any BID have an AID list that at least have all the results of AID from the first code (Ex. 1, 2, 3, 4, 5, 6 GOOD) (Ex. 1, 2, 3, 5 BAD)
Basically, each AID is either positive or negative for A1. Each BID is either positive or negative with each AID. I need to know which BID is positive for ALL of "the positive AID."
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.