Use the `WITH TIES` clause to return more than the `LIMIT`-ed amount when there are multiple results with the same value

Use the `WITH TIES` clause to return more than the `LIMIT`-ed amount when there are multiple results with 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!

We're writing a book, you can get it for free here.