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

Subqueries in query builder/PHQL

I was wondering if subqueries were supported for the FROM clause in Phalcon 2.0.5. I saw that they are supported in at least the WHERE clause.

I'm trying to do something similar to :

    SELECT columnA, columnB, columnC`
    FROM (SELECT Column A, ColumnB, TableB.ColumnC`
        FROM TableA
        JOIN TableB ON TableA.TableBId = TableB.id) AS temp
    WHERE ColumnB != 1;

Is that supported, or will I have to figure something else out ?


i think its still unavaible, but phql improvemnts should come in the near future


Not sure why you need such a weird query? Just do normal join and normal FROM.