Hello.
Is there way to set up the alias name for the AVG column in the QueryBuilder?
I can not find answer in the docs, please help.
You can pass an associative array using the keys as aliases:
$builder->columns(["average" => "avg(price)"])
Thank you for the reply! I think it's should be in the documentation, here: https://docs.phalcon.io/en/latest/reference/phql.html#creating-queries-using-the-query-builder
You can also write:
$builder->columns('avg(price) AS average')
(Or are there advantages to using the array format?)