I am trying to get a result that I need to sort in ascending order. But some values ββwill be empty / empty, I need them to be the last, and the sorting starts at 0 1 2 and then null.
I tried SortableNullsWalker but that didn't help. The value that I am sorting is not a column, its multiplying by two values ββthat are sorting, which is why I believe SortableNullsWalker is not working. Any help please
$dql = 'SELECT (column1 * column2) as distance FROM table)
ORDER BY distance ASC ';
$dq = $this->getEntityManager()->createQuery($dql);
The result is obtained as '', '', 0, 1, 2.334, ....
But I'm trying to do it like: 0, 1, 2.334,......, '', ''
source
share