Package org.h2.command.query

# Class SelectListColumnResolver

java.lang.Object
org.h2.command.query.SelectListColumnResolver

All Implemented Interfaces:
  `ColumnResolver`

public class SelectListColumnResolver extends Object implements ColumnResolver
This class represents a column resolver for the column list of a SELECT statement. It is used to resolve select column aliases in the HAVING clause. Example:

SELECT X/3 AS A, COUNT(*) FROM SYSTEM_RANGE(1, 10) GROUP BY A HAVING A > 2;

## Method Summary

Modifier and Type
Method
Description
`Column`
`findColumn(String name)`
Get the column with the specified name.
`Column[]`
`getColumns()`
Get the column list.
`Select`
`getSelect()`
Get the select statement.
`Value`
`getValue(Column column)`
Get the value for the given column.
`Expression`
`optimize(ExpressionColumn expressionColumn, Column column)`
Get the expression that represents this column.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.h2.table.ColumnResolver

`getColumnName, getRowIdColumn, getSchemaName, getSystemColumns, getTableAlias, getTableFilter, hasDerivedColumnList`

## Method Details

### getColumns

public Column[] getColumns()
Description copied from interface: `ColumnResolver`
Get the column list.

Specified by:
  `getColumns` in interface `ColumnResolver`
Returns:
  the column list

### findColumn

public Column findColumn(String name)
Description copied from interface: `ColumnResolver`
Get the column with the specified name.

Specified by:
  `findColumn` in interface `ColumnResolver`
Parameters:
  `name` - the column name, must be a derived name if this column resolver has a derived column list
Returns:
  the column with the specified name, or `null`

### getSelect

public Select getSelect()
Description copied from interface: `ColumnResolver`
Get the select statement.

Specified by:
  `getSelect` in interface `ColumnResolver`
Returns:
  the select statement

### getValue

public Value getValue(Column column)
Description copied from interface: `ColumnResolver`
Get the value for the given column.

Specified by:
  `getValue` in interface `ColumnResolver`
Parameters:
  `column` - the column
Returns:
  the value

### optimize

public Expression optimize(ExpressionColumn expressionColumn, Column column)
Description copied from interface: `ColumnResolver`
Get the expression that represents this column.

Specified by:
  `optimize` in interface `ColumnResolver`
Parameters:
  `expressionColumn` - the expression column
  `column` - the column
Returns:
  the optimized expression