We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 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();



98.9k

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