Phalcon 2.0 PHQL Distinct


I was checking out 2.0 and one of my PHQL queres uses distinct. It works fine in 1.3.4 but omits the column in 2.0. I was wondering if anybody knows if this is known issue or if there is newer syntax for using distinct in PHQL?

2.0 is supposed to have 100% feature parity with the 1.x branch. If you can distill this down to a simple example case, it would make a good bug report.

Essentially a statement such as:


This won't return "value" in 2.0 but returns fine in 1.3.4 when using PHQL.

Alex, did you find a solution? I think I might have a similar situation here:

$query = $this->modelsManager->createQuery('SELECT DISTINCT id, name FROM App\Models\Brands');
$result = $query->execute();

Dumping the returned result shows the following. It seems that the first column is returned as "_0", regardless of the column. (Switching the order of name and id still returned the first column as "_0".

[_pdoStatement:protected] => PDOStatement Object
[queryString] => SELECT DISTINCT AS _0, AS name FROM brands
[_sqlStatement:protected] => SELECT DISTINCT AS _0, AS name FROM brands