To clarify my question, how could I implement a "from" subquery with XPDO ?
As explained
here:
SELECT AVG(sum_column1)
FROM (SELECT SUM(column1) AS sum_column1
FROM t1 GROUP BY column1) AS t1;is a valid query.
For instance, even this doesn’t any sense, try under phpMyAdmin (modify the table prefix):
SELECT AVG(sum_published)
FROM (SELECT SUM(published) AS sum_published
FROM revo_site_content GROUP BY published) AS t1;
I set the inner select with:
$c = $this->modx->newQuery(’modResource’);
$c->select(array(’SUM(published) AS sum_published’));
$c->groupby(’published’);
ok, but with this first xPDOQuery how could I set the final query ?
Here this is a very simple (without any interest) query, but if needed I have a realistic example.