title: SQL SELECT DISTINCT Puzzle
body: <p>I'm trying to create a query from two tables.</p>
  
  <p>The first table is 'Document Type' and the second one 'Document'  Document Type is, if you like a category, and 'Document' contains details about the document itself.  They are related (ie 'Document' contains a field which relates to the key field of 'Document Type').</p>
  
  <p>Simplified, the tables look like this:-</p>
  
  <pre><code>Document Type
  =============
  TypeID
  TypeName
  TypeDescription
  
  
  Document
  ========
  DocumentID
  DocumentType (fk of TypeID)
  DocumentRequired
  </code></pre>
  
  <p>The query I'm running takes a DISTINCT list of Document types - this is the first and easiest bit.</p>
  
  <p>What I'm wanting to do is to add a column to the query which then looks under 'Document' and, if there have ever been any related documents where 'DocumentRequired' is equal to TRUE, displays a TRUE/Yes value.  If not, show FALSE/No.</p>
  
  <p>I've tried creating a join but obviously if there are any categories which contain both required/non-required documents I get duplication.  All I want is a yes/no flag.</p>
  
  <p>Can somebody help?</p>