title: extend TSQL Select statement, based on bool value
body: <p>I'm trying to find out if I can selectively include or omit content from certain tables based on a Boolean flag in one table.</p>
  
  <p>There are 2 tables in question, and i'd like to do the following:</p>
  
  <pre><code>SELECT id, isValid From Table1
  
  If isValid = true THEN select * from Table2
  </code></pre>
  
  <p>Basically, if a given field is true, then include another select statement, in the main <code>select</code> statement, otherwise don't.</p>
  
  <p>Is this possible?</p>
  
  <p><strong><em>UPDATE</em></strong>
  Just to make it a little clearer - and try and explain what i'm trying to achieve.</p>
  
  <p>Table 1 contains 13 fields, while table 2 contains 4 fields. Both table have a relationship, using id (not the real name, just used in this example).</p>
  
  <p>So, whenever field isValid is set to true in table 1, then I need all the corresponding information from table 2 where the id's match. If isValid is false, then dont select anything from table 2</p>