How to make recursive query in SQLite?

前端 未结 4 1622

if my data structure is like this

parentA
-------parentAA
--------------parentAAA
---------------------childA

if i can get \"childA.name\" . h

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-11 06:47

    In this SQLite Release 3.8.3 On 2014-02-03 has been added support for CTEs. Here is documentation WITH clause Example:

    WITH RECURSIVE
    cnt(x) AS (
     SELECT 1
     UNION ALL
     SELECT x+1 FROM cnt
      LIMIT 1000000
    )
    SELECT x FROM cnt;
    

提交回复
热议问题