Skip to content

Commit d043dcd

Browse files
committed
Update Patterns Recursive CTEs.md
1 parent 0f2f5da commit d043dcd

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Patterns Recursive CTEs.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ Recursive CTEs enable the implementation of the following task. Suppose we have
4848

4949
~~~sql
5050
WITH RECURSIVE
51-
folders(path_old) AS (
52-
VALUES
53-
('doc/thesis/exp'),
54-
('doc/thesis/theory'),
55-
('doc/app/job/lor'),
56-
('code/scripts/py'),
57-
('code/scripts/bas')
58-
),
51+
folders(path_old) AS (
52+
VALUES
53+
('doc/thesis/exp'),
54+
('doc/thesis/theory'),
55+
('doc/app/job/lor'),
56+
('code/scripts/py'),
57+
('code/scripts/bas')
58+
),
5959
ops(opid, rootpath_old, rootpath_new) AS (
6060
VALUES
61-
(1, 'doc/', 'docABC' ),
62-
(2, 'docABC/thesis/', 'docABC/master' ),
63-
(3, 'docABC/app/job/', 'docABC/app/academic_job'),
64-
(4, 'code/', 'prog' )
61+
(1, 'doc/', 'docABC' ),
62+
(2, 'docABC/thesis/', 'docABC/master' ),
63+
(3, 'docABC/app/job/', 'docABC/app/academic_job'),
64+
(4, 'code/', 'prog' )
6565
),
6666
LOOP_COPY AS (
6767
-- Initial SELECT --
@@ -75,7 +75,7 @@ WITH RECURSIVE
7575
UNION ALL
7676
-- Append the processing queue with new paths generated by the current operation
7777
SELECT ops.opid,
78-
rootpath_new || substr(path_new, length(rootpath_old)) AS path_new
78+
rootpath_new || substr(path_new, length(rootpath_old)) AS path_new
7979
FROM LOOP_COPY AS BUFFER, ops
8080
WHERE ops.opid = BUFFER.opid + 1
8181
AND BUFFER.path_new like rootpath_old || '%'

0 commit comments

Comments
 (0)