Skip to main content
This page has instructions for making SQL against CockroachDB from various programming languages.

Before you begin

Before reading this page, do the following:
  • or .
  • .
  • .
  • that you now want to run queries against.
When running under the default isolation level, your application should that can occur under .

Simple selects

For more information about how to use the built-in SQL client, see the reference docs.
For complete examples, see:
  • (pgx)
For complete examples, see:
  • (JDBC)
For complete examples, see:
  • (psycopg3)

Order results

To order the results of a query, use an ORDER BY clause. For example:
For reference documentation and more examples, see the syntax page.

Limit results

To limit the results of a query, use a LIMIT clause. For example:
For reference documentation and more examples, see the syntax page.

Joins

The syntax for a with a two-way is shown below.
Join performance can be a big factor in your application’s performance. For more information about how to make sure your SQL performs well, see .

See also

Reference information related to this task:
Other common tasks: