title: filtering rows from mysql column if it does not exist in other table query
body: <p>I have two tables and i want to get the result if it exists in tableA only
  for example you can  see that in tableA 081 ID does not exist but in tableB column it exist
  so if we do this query</p>
  <pre><code> tableA table
  
  
  
   ID    SID         actions
     08     60420       082
     08     60420       083
     08     60420       084
  </code></pre>
  <p>but in  my query for above output is</p>
  <pre><code>   SELECT * FROM tableB where SID='60420' and PID='08' order by id desc limit 10
  
   tableB 
  
  
    ID      SID      PID
    081     60420      08 
    082     60420      08 
    083     60420      08 
    084     60420      08 
  </code></pre>
  <p>PID of tableB and ID of tableA are same as you can see in output. SID is also same for particular customer
  how can  i ensure that it removes 081 rows from the output as it is not existing in tableA
  or is it possible i delete 081 rows from tableB so that my query still works without any issue
  i tried join but as SID is not unique it results in many rows as output
  should i try distinct ?? i did not try distinct as it may have some performance issues
  any help will be great</p>