Created
August 21, 2018 18:28
-
-
Save kura1420/d0acd9c6077e051333940e9f8bb9094b to your computer and use it in GitHub Desktop.
MariaDB Recursive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT member_id | |
| FROM | |
| (SELECT * FROM member ORDER BY member_parent, member_id ASC) as a, | |
| (SELECT @pv := 2) initialisation | |
| WHERE find_in_set(member_parent, @pv) > 0 AND @pv := CONCAT(@pv, ',', member_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment