title: Many to Many relation query with dynamic where clause
body: <p>My tables are :</p>
  
  <pre><code>Table Emp:-
  EmpId, EmpName
  
  Table EmpDeptTrans:-
  EmpDeptID, EmpID, DeptID
  
  table Dept:-
  DeptID, DeptName
  </code></pre>
  
  <p>Business logic is that one employee can work in multiple department and one department can have multiple employees, so basically its many to many relation.</p>
  
  <p>i need help in forming the SQL query where i can put my conditions like:</p>
  
  <p><code>(dept='Engineering' and dept='Account' ) And (dept ='Library' or dept ='HR')</code></p>
  
  <p>my where condition is dynamic and can change based on requirement...</p>