AI agents: Read [llms.txt](https://kysely.dev/llms.txt) for the documentation index and links to Markdown (.md) versions of individual pages. Read [llms-full.txt](https://kysely.dev/llms-full.txt) for the full documentation in one file.

* [](https://kysely.dev/index.md)
* [Examples](https://kysely.dev/docs/category/examples.md)
* SELECT

# SELECT

Short and simple examples of using the SELECT methods.

## [📄️A single column](https://kysely.dev/docs/examples/select/a-single-column.md)

[Select a single column:](https://kysely.dev/docs/examples/select/a-single-column.md)

## [📄️Column with a table](https://kysely.dev/docs/examples/select/column-with-a-table.md)

[Select a single column and specify a table:](https://kysely.dev/docs/examples/select/column-with-a-table.md)

## [📄️Multiple columns](https://kysely.dev/docs/examples/select/multiple-columns.md)

[Select multiple columns:](https://kysely.dev/docs/examples/select/multiple-columns.md)

## [📄️Aliases](https://kysely.dev/docs/examples/select/aliases.md)

[You can give an alias for selections and tables by appending as the\_alias to the name:](https://kysely.dev/docs/examples/select/aliases.md)

## [📄️Complex selections](https://kysely.dev/docs/examples/select/complex-selections.md)

[You can select arbitrary expression including subqueries and raw sql snippets.](https://kysely.dev/docs/examples/select/complex-selections.md)

## [📄️Not null](https://kysely.dev/docs/examples/select/not-null.md)

[Sometimes you can be sure something's not null, but Kysely isn't able to infer](https://kysely.dev/docs/examples/select/not-null.md)

## [📄️Function calls](https://kysely.dev/docs/examples/select/function-calls.md)

[This example shows how to create function calls. These examples also work in any](https://kysely.dev/docs/examples/select/function-calls.md)

## [📄️Distinct](https://kysely.dev/docs/examples/select/distinct.md)

[The API documentation is packed with examples. The API docs are hosted here,](https://kysely.dev/docs/examples/select/distinct.md)

## [📄️Distinct on](https://kysely.dev/docs/examples/select/distinct-on.md)

[The API documentation is packed with examples. The API docs are hosted here,](https://kysely.dev/docs/examples/select/distinct-on.md)

## [📄️All columns](https://kysely.dev/docs/examples/select/all-columns.md)

[The selectAll method generates SELECT \*:](https://kysely.dev/docs/examples/select/all-columns.md)

## [📄️All columns of a table](https://kysely.dev/docs/examples/select/all-columns-of-a-table.md)

[Select all columns of a table:](https://kysely.dev/docs/examples/select/all-columns-of-a-table.md)

## [📄️Nested array](https://kysely.dev/docs/examples/select/nested-array.md)

[While kysely is not an ORM and it doesn't have the concept of relations, we do provide](https://kysely.dev/docs/examples/select/nested-array.md)

## [📄️Nested object](https://kysely.dev/docs/examples/select/nested-object.md)

[While kysely is not an ORM and it doesn't have the concept of relations, we do provide](https://kysely.dev/docs/examples/select/nested-object.md)

## [📄️Generic find query](https://kysely.dev/docs/examples/select/generic-find-query.md)

[A generic type-safe helper function for finding a row by a column value:](https://kysely.dev/docs/examples/select/generic-find-query.md)

[Previous](https://kysely.dev/docs/category/examples.md)

[Examples](https://kysely.dev/docs/category/examples.md)

[Next](https://kysely.dev/docs/examples/select/a-single-column.md)

[A single column](https://kysely.dev/docs/examples/select/a-single-column.md)
