-2
我有下面的表結構。 (我是新來的SQL精簡版)SQL Lite中的遞歸查詢CTE
create table Relations
(
Code int,
ParentCode int ,
fname text
)
GO
insert into Relations values(1,null,'A');
insert into Relations values(2,null,'B');
insert into Relations values(3,2,'C');
insert into Relations values(4,3,'D');
我想代碼的原始母體= 4: 即值2空乙
我無法弄清楚如何編寫遞歸查詢以sqllite表示。 在此先感謝..
哪一部分[文件]中(http://www.sqlite.org/lang_with.html)你不明白嗎? –