再帰処理をSQLで記述する Write recursive processing in SQL

Channel:
Subscribers:
953
Published on ● Video Link: https://www.youtube.com/watch?v=X73Vi9wjWrI



Duration: 4:02
410 views
2


再帰SQLの例題は「ハノイの塔」です

MMMの練習用に作ってみました 。
呼吸動作が思うように出来ませんでした。

動画作製に使用したソフト :
MikuMikuMoving V2 → sm31700304
LipSynchloid → sm22506025
DeleteFramePlugin → sm19579320
モーション・ポーズ連結ツール → sm25940359
RandomBlinkPlugin改 → https://twitter.com/aice_black/status/438305238236139521
AviUtl → http://spring-fragrance.mints.ne.jp/aviutl/
x264guiEx → https://rigaya34589.blog.fc2.com/
PostgreSQL → https://www.postgresql.org/

使用したコンテンツ :
ハノイの塔7段 → https://www.youtube.com/watch?v=TY8Uxzo--Nw
東北ずん子のイラスト/3Dデータ → https://zunko.jp/con_illust.html

■作製したSQL
※<>は半角に変換してね

WITH RECURSIVE hanoi as (
select 5 as nokori,'a' as f,'b' as d,'c' as w, '' as syori, 1 as step, '001' as lank
union all
select nokori -1
,case s.step when 1 then f when 2 then '' when 3 then w end
,case s.step when 1 then w when 2 then '' when 3 then d end
,case s.step when 1 then d when 2 then '' when 3 then f end
,case s.step when 1 then '' when 2 then 'move lv' || nokori || ' from ' || f || ' to ' || d when 3 then '' end
,s.step
,hanoi.lank || ',' || to_char(s.step,'000')
from hanoi
inner join (
select 1 as step
union all
select 2 as step
union all
select 3 as step
) as s on ( hanoi.step <> 2 )
where nokori > 0
)
select * from hanoi
where step = 2
order by lank
;




Other Videos By 誰かさん


2018-08-29Drakengard2 ドラッグ オン ドラグーン2 scene 58 第十一章 神話 三節 上空
2018-08-26FINAL FANTASY CRYSTAL CHRONICLES scene 10 ヴェオ・ル水門
2018-08-25Drakengard2 ドラッグ オン ドラグーン2 scene 57 第十一章 神話 二節 上空
2018-08-22Drakengard2 ドラッグ オン ドラグーン2 scene 56 第十一章 神話 一節 上空
2018-08-19Drakengard2 ドラッグ オン ドラグーン2 scene 55 第十章 崩壊 二節 大神殿
2018-08-18FINAL FANTASY CRYSTAL CHRONICLES scene 09 ジャック・モキートの館
2018-08-15Drakengard2 ドラッグ オン ドラグーン2 scene 54 第十章 崩壊 一節 上空
2018-08-12MMDによる解説動画の作り方を解説
2018-08-12FINAL FANTASY CRYSTAL CHRONICLES scene 08 ティダの村
2018-08-11Drakengard2 ドラッグ オン ドラグーン2 scene 53 第十章 崩壊 フリーミッション 女神の城
2018-08-08再帰処理をSQLで記述する Write recursive processing in SQL
2018-08-08Drakengard 2 ドラッグ オン ドラグーン2 scene 52 第十章 崩壊 フリーミッション 聖地 上空
2018-08-05Drakengard 2 ドラッグ オン ドラグーン2 scene 51 九章 復活 三節 上空
2018-08-04FINAL FANTASY CRYSTAL CHRONICLES scene 07 アルフィタリア城
2018-08-01Drakengard 2 ドラッグ オン ドラグーン2 scene 50 九章 復活 二節 女神の城
2018-07-29Drakengard 2 ドラッグ オン ドラグーン2 scene 49 九章 復活 一節 上空
2018-07-28Drakengard 2 ドラッグ オン ドラグーン2 scene 48 八章 覇道 六節 上空
2018-07-25FINAL FANTASY CRYSTAL CHRONICLES scene 06 Goblin Wall
2018-07-22Drakengard 2 ドラッグ オン ドラグーン2 scene 47 八章 覇道 五節 時の聖壇
2018-07-21Drakengard 2 ドラッグ オン ドラグーン2 scene 46 八章 覇道 四節 天時塔
2018-07-19自作サーバーでSparkクラスタをKubernetes上に構築してみた Running Apache Spark on Kubernetes in Homebrew junk Server



Tags:
Tower of Hanoi
Recursive processing
再帰処理
再帰SQL
PostgreSQL
MMM
ハノイの塔