title: Convert an in query to join
body: <p>Can i get some help to clean up following query and possibly convert it to joins.</p>
  
  <pre><code>SELECT pd.id, pd.title, pd.vacation_type_ids, pd.auto_vacation_theme
  FROM property_details pd
  WHERE pd.company_id =247
  AND pd.status =  "active"
  AND pd.id NOT 
  IN (
      SELECT d.property_id
      FROM property_discount d
      WHERE (
      (
      d.start_date &lt;= CAST(  "2012-04-15" AS DATE ) 
      AND d.end_date &gt;= CAST(  "2012-04-15" AS DATE ) 
      AND d.start_date &lt;= CAST(  "2012-04-17" AS DATE ) 
      AND d.end_date &gt;= CAST(  "2012-04-17" AS DATE )
      )
      OR (
      d.start_date &gt;= CAST(  "2012-04-15" AS DATE ) 
      AND d.start_date &lt;= CAST(  "2012-04-17" AS DATE )
      )
      OR (
      d.end_date &gt;= CAST(  "2012-04-15" AS DATE ) 
      AND d.end_date &lt;= CAST(  "2012-04-17" AS DATE )
      )
  )
  )
  </code></pre>
  
  <p>I am not an expert with MySQL so sorry if i have did something wrong</p>