Class TableSelectStatement
Represents a chaining table select statement.
Inheritance
Namespace: MySqlX.XDevAPI.Relational
Assembly: MySql.Data.dll
Version: 9.1.0
Syntax
public class TableSelectStatement : FilterableStatement<TableSelectStatement, Table, RowResult, string>
Methods
Execute()
Executes the select statement.
Declaration
public override RowResult Execute()
Returns
Type | Description |
---|---|
RowResult | A Result object containing the results of the execution and data. |
Overrides
GroupBy(String[])
Sets the table aggregation.
Declaration
public TableSelectStatement GroupBy(params string[] groupBy)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | groupBy | The column list for aggregation. |
Returns
Type | Description |
---|---|
TableSelectStatement | This same TableSelectStatement object set with the specified group-by criteria. |
Having(String)
Filters criteria for aggregated groups.
Declaration
public TableSelectStatement Having(string having)
Parameters
Type | Name | Description |
---|---|---|
System.String | having | The filter criteria for aggregated groups. |
Returns
Type | Description |
---|---|
TableSelectStatement | This same TableSelectStatement object set with the specified filter criteria. |
LockExclusive(LockContention)
Locks matching rows so no other transaction can read or write to it.
Declaration
public TableSelectStatement LockExclusive(LockContention lockOption = LockContention.Default)
Parameters
Type | Name | Description |
---|---|---|
LockContention | lockOption | Optional row lock option to use. |
Returns
Type | Description |
---|---|
TableSelectStatement | This same TableSelectStatement object set with the lock exclusive option. |
Exceptions
Type | Condition |
---|---|
MySqlException | The server version is lower than 8.0.3. |
LockShared(LockContention)
Locks matching rows against updates.
Declaration
public TableSelectStatement LockShared(LockContention lockOption = LockContention.Default)
Parameters
Type | Name | Description |
---|---|---|
LockContention | lockOption | Optional row lock option to use. |
Returns
Type | Description |
---|---|
TableSelectStatement | This same TableSelectStatement object set with lock shared option. |
Exceptions
Type | Condition |
---|---|
MySqlException | The server version is lower than 8.0.3. |
OrderBy(String[])
Sets user-defined sorting criteria for the operation. The strings use normal SQL syntax like "order ASC" or "pages DESC, age ASC".
Declaration
public TableSelectStatement OrderBy(params string[] order)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | order | The order criteria. |
Returns
Type | Description |
---|---|
TableSelectStatement | A generic object that represents the implementing statement type. |