title: How to replace IN clause with JOIN in sql?
body: <p>I have following query .</p>
  
  <pre><code>select entity_id ,parent_id,name as label , url_key as name from magento_catalog_category_flat_store_1 where entity_id IN(
  SELECT distinct T1.parent_id
  FROM magento_catalog_category_flat_store_1 T1 
  INNER JOIN magento_catalog_category_flat_store_1 as T2 ON 
             T1.entity_id = T2.parent_id
  RIGHT JOIN sohyper_region_activity as T3 on 
             T2.entity_id = T3.activity_id)
  </code></pre>
  
  <p>The above query decreases the performance because of IN clause . Can anyone tell me how to replace IN clause with JOIN in this query ?</p>
  
  <p>Thanks.</p>