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)
* JOIN

# JOIN

Examples of queries that use JOINs.

## [📄️Simple inner join](https://kysely.dev/docs/examples/join/simple-inner-join.md)

[Simple inner joins can be done by providing a table name and two columns to join:](https://kysely.dev/docs/examples/join/simple-inner-join.md)

## [📄️Aliased inner join](https://kysely.dev/docs/examples/join/aliased-inner-join.md)

[You can give an alias for the joined table like this:](https://kysely.dev/docs/examples/join/aliased-inner-join.md)

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

[You can provide a function as the second argument to get a join](https://kysely.dev/docs/examples/join/complex-join.md)

## [📄️Subquery join](https://kysely.dev/docs/examples/join/subquery-join.md)

[You can join a subquery by providing two callbacks:](https://kysely.dev/docs/examples/join/subquery-join.md)

[Previous](https://kysely.dev/docs/examples/where/complex-where-clause.md)

[Complex where clause](https://kysely.dev/docs/examples/where/complex-where-clause.md)

[Next](https://kysely.dev/docs/examples/join/simple-inner-join.md)

[Simple inner join](https://kysely.dev/docs/examples/join/simple-inner-join.md)
