Clauses

In SurrealQL, clauses can be used to alter the way a query is executed. They are used in the following ways:

  • EXPLAIN: Explain the query plan.

  • FETCH: Fetch all the fields of related records.

  • FROM: Specify the table(s) or other target(s) to query from.

  • GROUP BY: Group the results by a set of fields.

  • LIMIT: Limit the number of results.

  • OMIT: Omit related records.

  • ORDER BY: Specify the sort order of the results.

  • SPLIT: Split the results into a set of subqueries.

  • WHERE: Specify a condition that acts as a filter.

  • WITH: Replace the default table iterator with an index iterator.