1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 21:34:03 +00:00
laravel-tips/content/tips/use-common-table-expressions-to-refine-your-data-in-complex-eloquent-queries.md
2021-11-12 18:43:31 +01:00

13 lines
No EOL
639 B
Markdown

---
title: 'Use Common Table Expressions to refine your data in complex Eloquent queries'
tweet_id: '1459206743095791621'
thread_slug: weekly-thread-2021-45
author_username: tobias_petry
images:
- 'https://pbs.twimg.com/media/FDrtE0kWQAYSuwK.jpg'
created_at: 2021-11-12T17:09:32+00:00
slug: use-common-table-expressions-to-refine-your-data-in-complex-eloquent-queries
---
⚡️ Database Tip
Sometimes you have very complex queries involving multiple calculation steps. Instead of nesting queries or doing it in application code you can use Common Table Expressions (CTE) to refine your data in every step and even reuse former steps.