Skip to content

Commit

Permalink
Update the connect_by_root example, for better semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangSongZ committed Jan 12, 2023
1 parent 65da245 commit c12abf3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/sql_migration/sql_migration04.md
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ The example below shows migration when the root data is displayed.
<tbody>
<tr>
<td align="left">
<pre><code>SELECT staff_id, name, <b>CONNECT_BY_ROOT name as "ROOT" </b>
<pre><code>SELECT staff_id, name, <b>CONNECT_BY_ROOT name as "Manager" </b>
FROM staff_table
START WITH staff_id = '1001'
CONNECT BY PRIOR staff_id = manager_id;
Expand All @@ -855,15 +855,15 @@ The example below shows migration when the root data is displayed.
<td align="left">
<pre><code>WITH RECURSIVE staff_table_w( staff_id,
name,
ROOT ) AS
Manager ) AS
( SELECT staff_id, name, <b>name </b>
FROM staff_table
UNION ALL
SELECT n.staff_id, n.name, <b>w.ROOT </b>
SELECT n.staff_id, n.name, <b>w.Manager </b>
FROM staff_table n, staff_table_w w
WHERE w.staff_id = n.manager_id
)
SELECT staff_id, name, ROOT
SELECT staff_id, name, Manager
FROM staff_table_w;</code></pre>
</td>
</tr>
Expand Down

0 comments on commit c12abf3

Please sign in to comment.