 <p>You can use <code>NOT EXISTS</code> to exclude holidays:</p> <pre><code>SELECT * FROM time_dimension ti WHERE NOT EXISTS(SELECT 1 FROM tbl_holidays WHERE startdate = ti.db_date) AND day_name IN ('Monday','Tuesday','Wednesday','Thursday','Friday'); </code></pre>