MySQL Forums
Forum List  »  Newbie

Re: Tree behavior - Make this query compatible with mysql with sql_mode=only_full_group_by
Posted by: Patrick FAURE
Date: August 26, 2017 03:24AM

Thank you for your answer. Sorry for the delay of this answer.

Here is my new query string:

"SELECT n.id, n.industry_naf, count(*)-1 AS level, round((n.rght - n.lft)/2) AS offspring FROM xxxxxx.industries AS n, xxxxxx.industries AS p WHERE n.lft BETWEEN p.lft AND p.rght GROUP BY n.id, n.lft HAVING level = 4 ORDER BY n.lft;"

All works fine!

Patrick

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.