Jan-Lukas Else

Thoughts of an IT expert

Published on in šŸ’¬ Micro
Short link: https://b.jlel.se/s/273
āš ļø This entry is already over one year old. It may no longer be up to date. Opinions may have changed.

This day is successful: I created a recursive SQL CTE in SQLite even before noon. šŸ¤“

with recursive f (i, fp, tp) as (select 1, fromPath, toPath
                                 from redirects
                                 where fromPath = ?
                                 union all
                                 select f.i + 1, r.fromPath, r.toPath
                                 from redirects as r
                                          join f on f.tp = r.fromPath)
select tp
from f
order by i desc
limit 1

This is for my new CMS project.

Tags: ,

Jan-Lukas Else
Interactions & Comments