Category : distinct

I’m trying to do that query : SELECT DISTINCT p.reference, p.name, p.range_id FROM reference as r INNER JOIN product as p WHERE p.reference = r.name; which will return a single reference name of a table. I tried with createQueryBuilder return $this->createQueryBuilder(‘p’) ->select(‘p.reference, p.name, p.id, p.price’)->distinct(‘r.name’) ->join(Reference::class, ‘r’, ‘WITH’, ‘p.reference = r.name’) ->getQuery() ->getResult() and it ..

Read more