diff --git a/README.md b/README.md index f8dbc4c..f96b2a5 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ ```sql -WITH RECURSIVE parent_path (id, title, description, path) AS +WITH RECURSIVE parent (id, title, description, path) AS ( SELECT id, title, description, title as path FROM items WHERE parent_id IS NULL UNION ALL SELECT items.id, items.title, items.description, CONCAT(parent.path, ' > ', items.title) - FROM parent_path AS parent JOIN items + FROM parent JOIN items ON parent.id = items.parent_id ) -SELECT * FROM parent_path WHERE id = 38; +SELECT * FROM parent WHERE id = 38; ``` \ No newline at end of file