title: Symfony2 , doctrine custom query
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12862389/symfony2-doctrine-create-custom-sql-query">Symfony2 &amp; Doctrine: Create custom SQL-Query</a>  </p>
  </blockquote>
  
  
  
  <p>I tried that on my symfony2 project :</p>
  
  <pre><code>$em = $this-&gt;getDoctrine()-&gt;getEntityManager();
  $query = $em-&gt;createQuery(
          'SELECT v.voiture,o.offre,m.marque
           FROM FrontOfficeBundle:Voiture v
           INNER JOIN FrontOfficeBundle:OffreSpecial o on o.voiture_id = v.id
           INNER JOIN FrontOfficeBundle:Marque m on m.id = v.marque_id'
      );
  $result = $query-&gt;getResult();
  </code></pre>
  
  <p>and get  that erreur :</p>
  
  <pre><code>[Syntax Error] line 0, col 122: Error: Expected Doctrine\ORM\Query\Lexer::T_WITH, got 'on'
  </code></pre>
  
  <p>even the SQL query are correcte ! plz help</p>