title: SQL Sub-select statements filter using where clause
body: <p>I am in the process of building a dashboard and need to extract some data from a somewhat complex schema.</p>
  
  <p>I have a select statement (see below) that I am using to extract information, but need to conduct some filtering on part of the select statement, and I'm struggling.</p>
  
  <pre><code>select distinct j.id 'Job_Id'
          , js.outcome 'Outcome'
          ,(select string from property where parent_sheet_id = ps.id and name= 'Build_Type') as 'Build_Type' 
      from job j, job_step js, property_sheet ps, property p
      where j.id = js.job_id
      and ps.entity_id=js.id
      and ps.id=p.parent_sheet_id
      and ps.entity_type='step'
      and p.name = 'Id'
      group by j.id
      order by j.id desc;
  </code></pre>
  
  <p>I am sure that there is a better way of doing this query, and I would appreciate any other suggestions, but I am mostly attempting to place a filter on the nested select statement which has an alias of "Build_Type", but when I try it appears not to work. I've read some blogs that this is not possible, so I am a little stuck.</p>
  
  <p>Any help would be much appreciated.</p>
  
  <p>Thanks.</p>