Answer the question
In order to leave comments, you need to log in
How to fill in the field?
Such a task, there is a table of reviews. Reviews are built hierarchically, that is, a tree. The original template is `Adjacency list , now the task is to add `full_path` the full path from the root to the current branch , for `parent_id` = 0 it's easy . full_path = concat(0,'/',this.id) . I am doing now for those whose parent_id is not zero. The idea is to set the element's full_path to parent.full_path plus the element's id . But the muscle does not work, how to fix the request.
UPDATE `barmen_comments`
set full_path=CONCAT(0,'/',(SELECT barcom.`full_path` FROM `barmen_comments` as barcom WHERE barcom.`comments_id` = `barmen_comments`.`parent_id`))
WHERE `barmen_comments`.`parent_id` != 0
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question