i am working on college ERP software where i couldn't be able to find solution on following problem. here i am shortly explain the problem
Table Student.
+----+--------+--------+
| id | enroll | sub_id |
+----+--------+--------+
| 1 | 1 | 1 |
| 2 | 1 | 2 |
| 3 | 2 | 1 |
| 4 | 2 | 2 |
| 5 | 2 | 3 |
| 6 | 3 | 1 |
| 7 | 3 | 2 |
+----+--------+--------+
Requirement - In student table, fetch only those enroll no. which have sub_id 1 & 2 if any enroll no. have assign 1,2 & 3 then it should not be come into the result.
I try to us IN function but i won't give right results. Please suggest me solution for this problem. Thanx...