Variavle in query MySQL 

Variavle in query MySQL 

  

SyntaxEditor Code Snippet

SELECT GROUP_CONCAT(lv SEPARATOR ',')
  FROM (SELECT @pv:=(SELECT GROUP_CONCAT(id SEPARATOR ',') 
          FROM MyTableOS
         WHERE FIND_IN_SET(parentid, @pv)) AS lv FROM MyTableOS
JOIN (SELECT @pv:= 62)tmp
WHERE id IN (@pv)) a

I would like to get all the children by the parent id.

Executing this query by WorkBench works and gives me the result '63, 64, 446, 447, 449, 450, 451, 456, 460, 445 '

62 -> 63.64

64 -> 445

63 -> 446, 447, 449, 450, 451,456,460

Running through an advanced query got the error "OSUSR_ is a reserved prefix in GetIds"

Are you querying OSUSR_YourTable directly in the advanced query instead of using {YourTable}?