SELECT COUNT(parent.NESTEDID) - 1 as depth, node.NESTEDID
FROM NESTED node, NESTED parent
WHERE node.LEFT
BETWEEN parent.LEFT
AND parent.RIGHT
GROUP BY node.NESTEDID
ORDER BY node.LEFT
Now I get the following error:
Fatal error: Uncaught exception 'Zend_Db_Statement_Oracle_Exception' with
message '979 ORA-00979: not a GROUP BY expression SELECT
COUNT(parent.NESTEDID) - 1 as depth, node.NESTEDID FROM NESTED node, NESTED
parent WHERE node.LEFT BETWEEN parent.LEFT AND parent.RIGHT GROUP BY
node.NESTEDID ORDER BY *node.LEFT '
Someone knows why this error occurs?
Matthias W. wrote:
>
> Hi,
>
> I just want to use nested sets in my Zend Framework app.
> I found this tutorial: http://dev.iordanov.net/archives/8
> http://dev.iordanov.net/archives/8
>
> My app can be used with MySql or Oracle DB -> and there's my problem:
> The statements in this tutorial are written by hand and so they aren't
> Oracle conform. I don't want to create different SQL-Strings for Mysql and
> Oracle DB so I have to use the Zend_Db_Select to create the selects. But
> my question is how to create statements like this:
>
> SELECT COUNT(parent.{$this->_primary[1]}) - 1 as depth,
> node.{$this->_toString}
> FROM {$this->_name} AS node, {$this->_name} AS parent
> WHERE node.{$this->_left}
> BETWEEN parent.{$this->_left}
> AND parent.{$this->_right}
> GROUP BY node.{$this->_primary[1]}
> ORDER BY node.{$this->_left}
>
> Is it possible to create this statement using Zend_Db_Select??
> I didn't found anything like this in the reference guide.
>
--
View this message in context: http://www.nabble.com/Nested-sets-and-Zend_Db_Select-tp23738200p23739029.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论