1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/you-can-use-recursive-queries-to-query-hierarchical-trees.md
Samuel Štancl 3f631cf1d2 Week 31/2022
2022-08-06 01:03:07 +02:00

618 B

title tweet_id thread_slug author_username images created_at slug
You can use recursive queries to query hierarchical trees 1555543666231369728 weekly-thread-2022-31 tobias_petry
https://pbs.twimg.com/media/FZOXjYuXwAA6ucp.jpg
2022-08-05T13:18:05+00:00 you-can-use-recursive-queries-to-query-hierarchical-trees

Database Tip

Recursive queries are a great solution to e.g. querying multiple levels in a tree with just one query. But you should use cycle detection otherwise your query might run forever or fail for loops in your data. https://sqlfordevs.io/cycle-detection-recursive-query