1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00
laravel-tips/content/tips/you-can-use-with-ties-instead-of-limit-to-return-more-results-if-they-have-the-same-value.md
Samuel Štancl 21b9739d84 Week 30/2022
2022-07-31 03:36:17 +02:00

682 B
Raw Permalink Blame History

title tweet_id thread_slug author_username images created_at slug
You can use WITH TIES instead of LIMIT to return more results if they have the same value 1553002673531543552 weekly-thread-2022-30 tobias_petry
https://pbs.twimg.com/media/FYqFF_wWAAAAGKm.jpg
2022-07-29T13:01:05+00:00 you-can-use-with-ties-instead-of-limit-to-return-more-results-if-they-have-the-same-value

Database Tip

Everyone knows the LIMIT clause. But what do you do if you want to have e.g. the employees with the TOP 3 salaries and not exclude the 4th or 5th one earning the same as the 3rd? The WITH TIES clause can return more results if the value is the same. Great!