We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Aliases and subquery

How can I add virtual column by using models query object.This one doesn`t work

$user = User::query() ->columns(array( '', '(SELECT COUNT() FROM user) AS UserCnt' )) ->execute();


Subqueries aren't supported by Phalcon, they're expected to be implemented soon.