Hi,
I am a bit lost with my recursive query. I handled functions but this
remains unclear.
WITH RECURSIVE ffi AS
(SELECT id, subject, base_folder_id, subject As subject_fullname
FROM folders
WHERE user_id = 40
UNION ALL
SELECT si.id,si.subject,
si.base_folder_id,
concat('/', sp.subject_fullname, '/', si.subject) As subject_fullname
FROM folders As si
INNER JOIN ffi AS sp
ON (si.base_folder_id = sp.id)
)
SELECT id, subject_fullname
FROM ffi
WHERE subject_fullname = '/folder/Sub folder'
ORDER BY subject_fullname;
Do I need an extension or any module to write this with Sequel or should I
write RAW SQL as stated above? I know this can be tricky and not fair but
could you please show me some example on Sequel?
Thanks,
Gencer.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.