๋ฐ์ํ
select id, name, parentfrom (select * from RecursionTest order by parent, id) products_sorted, (select @pv := '3') initialisationwhere find_in_set(parent, @pv) > 0and @pv := concat(@pv, ',', id)
์ถ์ฒ: http://bulkywebdeveloper.tistory.com/109 [๊ฑด๊ฐํ ์ฝ๋ฉ]
with recursive cte (id, name, parent) as( select id, name, parent from recursiontest where parent = 3 union all select r.id, r.name, r.parent from recursiontest r inner join cte on r.parent = cte.id)select * from cte;
์ถ์ฒ: http://bulkywebdeveloper.tistory.com/109 [๊ฑด๊ฐํ ์ฝ๋ฉ]
๋ฐ์ํ
'๊ฐ๋ฐ Life' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| ์ฝ๋์ด๊ทธ๋์ดํฐCI REST API IP๋์ญ๋ ํ์ฉ/์ฐจ๋จ (0) | 2019.01.22 |
|---|---|
| node js app.js , express generator, sequelize, pug (0) | 2019.01.09 |
| Oracle 12c ์ธ์คํด์ค ํด๋ผ์ด์ธํธ ์ค์น ์ ์ค๋ฅ (0) | 2018.12.10 |
| PHP, JS ๋ชจ๋ฐ์ผ ์ฒดํฌ (0) | 2018.11.15 |
| ํน์ ์์น์ ๋ฌธ์ ๋ณ๊ฒฝ (1) | 2018.11.13 |