Inspectopedia 2024.3 Help

Multiple row limiting/offset clauses in queries

Reports usages of multiple row limiting clauses in a single query.

Example (Microsoft SQL Server):

create table foo(a int); select top 1 * from foo order by a offset 10 rows fetch next 20 rows only;

The SELECT TOP clause is used to specify that only 1 record must be returned. The FETCH clause specifies the number of rows to return after the OFFSET clause has been processed. But as we already have the SELECT TOP limiting clause, the FETCH clause might be redundant.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

SqlMultipleLimitClauses
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | SQL

Last modified: 03 December 2024