title: Postgres "DISTINCT ON" equivalent in doctrine syntax. Symfony 1.4
body: <p>With doctrine syntax using postgres as database, is it possible to generate a query like:</p>
  
  <pre><code>SELECT 
  DISTINCT ON (people.email)
  *
  FROM people
  WHERE people.company SIMILAR TO '%companyA%|%companyB%|%...';
  </code></pre>
  
  <p>So far I have:</p>
  
  <pre><code>[...]
  $query= Doctrine_Query::create()-&gt;from('People p')
          -&gt;select('p.email, p.name, p.surname');
  
  $alias= $query-&gt;getRootAlias();
  
  foreach ($companies as $company){
      $query-&gt;orWhere($alias.'.name ilike ?', '%'.$company.'%');
  }
  [...]
  </code></pre>
  
  <p>I'm interested in the equivalent of "DISTINCT ON" for Doctrine ORM</p>
  
  <p>Thanks</p>