com.mysql.cj.xdevapi

## Interface SelectStatement

All Superinterfaces:
  Statement<SelectStatement,RowResult>

    public interface SelectStatement
    extends Statement<SelectStatement,RowResult>

A statement representing a SELECT query.

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.mysql.cj.xdevapi.Statement

`Statement.LockContention`

### Method Summary

All Methods Instance Methods Abstract Methods
`FilterParams` `getFilterParams()` Return `FilterParams` defined for this statement.
`SelectStatement` `groupBy(String... groupBy)` Add/replace the aggregation fields for this query.
`SelectStatement` `having(String having)` Add/replace the aggregate criteria for this query.
`SelectStatement` `limit(long numberOfRows)` Add/replace the row limit for this query.
`SelectStatement` `lockExclusive()` Locks matching rows exclusively so no other transactions can read or write to them.
`SelectStatement` `lockExclusive(Statement.LockContention lockContention)` Locks matching rows exclusively so no other transactions can read or write to them, using the provided lock contention option.
`SelectStatement` `lockShared()` Locks matching rows against updates.
`SelectStatement` `lockShared(Statement.LockContention lockContention)` Locks matching rows against updates using the provided lock contention option.
`SelectStatement` `offset(long limitOffset)` Add/replace the row offset for this query.
`SelectStatement` `orderBy(String... sortFields)` Add/replace the order specification for this query.
`SelectStatement` `where(String searchCondition)` Add/replace the search condition for this query.

### Methods inherited from interface com.mysql.cj.xdevapi.Statement

`bind, bind, bind, bind, clearBindings, execute, executeAsync`

### Method Detail

#### where

    SelectStatement where(String searchCondition)

Add/replace the search condition for this query.

Parameters:
  `searchCondition` - search condition expression
Returns:
  `SelectStatement`

#### groupBy

    SelectStatement groupBy(String... groupBy)

Add/replace the aggregation fields for this query.

Parameters:
  `groupBy` - groupBy expression
Returns:
  `SelectStatement`

#### having

    SelectStatement having(String having)

Add/replace the aggregate criteria for this query.

Parameters:
  `having` - having expression
Returns:
  `SelectStatement`

#### orderBy

    SelectStatement orderBy(String... sortFields)

Add/replace the order specification for this query.

Parameters:
  `sortFields` - sort expression
Returns:
  `SelectStatement`

#### limit

    SelectStatement limit(long numberOfRows)

Add/replace the row limit for this query.

Parameters:
  `numberOfRows` - limit
Returns:
  `SelectStatement`

#### offset

    SelectStatement offset(long limitOffset)

Add/replace the row offset for this query.

Parameters:
  `limitOffset` - limit offset
Returns:
  `SelectStatement`

#### lockShared

    SelectStatement lockShared()

Locks matching rows against updates.

Returns:
  `SelectStatement`

#### lockShared

    SelectStatement lockShared(Statement.LockContention lockContention)

Locks matching rows against updates using the provided lock contention option.

Parameters:
  `lockContention` - The `Statement.LockContention` value to set.
Returns:
  `SelectStatement`

#### lockExclusive

    SelectStatement lockExclusive()

Locks matching rows exclusively so no other transactions can read or write to them.

Returns:
  `SelectStatement`

#### lockExclusive

    SelectStatement lockExclusive(Statement.LockContention lockContention)

Locks matching rows exclusively so no other transactions can read or write to them, using the provided lock contention option.

Parameters:
  `lockContention` - The `Statement.LockContention` value to set.
Returns:
  `SelectStatement`

#### getFilterParams

    FilterParams getFilterParams()

Return `FilterParams` defined for this statement.

Returns:
  `FilterParams`

Copyright © 2016, 2026, Oracle and/or its affiliates.