title: How can I fetch ID from multiple tag selected from database
body: <p>Actully I have 3 tables <strong>mail</strong>, <strong>tags</strong> and <strong>tag_assigned</strong>  </p>
  
  <p>I am using filter query of multiple tag selected mail list. </p>
  
  <p><strong>For e.g.</strong> : From the screenshot I need to fetch <code>mailid</code> from  this table where selected tags <code>id</code> 1 and 2.</p>
  
  <p>I want to return <code>mailid</code> 4 and 1. How to get these ids from this table.</p>
  
  <p>I need sql query for this...</p>
  
  <p>Screen Shot:
  <a href="https://i.stack.imgur.com/euiSM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/euiSM.png" alt="enter image description here"></a></p>