Project: ClickHouse (App Definition and Development / Database)
File: ansi.md

slug: /en/sql-reference/ansi sidebar_position: 40 sidebar_label: ANSI Compatibility title: "ANSI SQL Compatibility of ClickHouse SQL Dialect" :::note This article relies on Table 38, Feature taxonomy and definition for mandatory features, AnnexF of . ::: The following table lists cases when query feature works in ClickHouse, but behaves not as specified in ANSI

| FeatureID | Feature Name | Difference | ||--|--| | E011 | Numeric data types | Numeric literal with period is interpreted as approximate (`Float64`) instead of exact (`Decimal`) | | E051-05 | Select items can be renamed | Item renames have a wider visibility scope than just the SELECT result | | E141-01 | NOT NULL constraints | `NOT NULL` is implied for table columns by default | | E011-04 | Arithmetic operators | ClickHouse overflows instead of checked arithmetic and changes the result data type based on custom rules | | FeatureID | Feature Name | Status | Comment | ||--|-|-| | E011 | Numeric data types | <span class="text-warning">Partial</span> | | | E011-01 | INTEGER and SMALLINT data types | <span class="text-success">Yes</span> | | | E011-02 | REAL, DOUBLE PRECISION and FLOAT data types data types | <span class="text-success">Yes</span> | | | E011-03 | DECIMAL and NUMERIC data types | <span class="text-success">Yes</span> | | | E011-04 | Arithmetic operators | <span class="text-success">Yes</span> | | | E011-05 | Numeric comparison | <span class="text-success">Yes</span> | | | E011-06 | Implicit casting among the numeric data types | <span class="text-danger">No</span> | ANSI SQL allows arbitrary implicit cast between numeric types, while ClickHouse relies on functions having multiple overloads instead of implicit cast | | E021 | Character string types | <span class="text-warning">Partial</span> | | | E021-01 | CHARACTER data type | <span class="text-success">Yes</span> | | | E021-02 | CHARACTER VARYING data type | <span class="text-success">Yes</span> | | | E021-03 | Character literals | <span class="text-success">Yes</span> | | | E021-04 | CHARACTER_LENGTH function | <span class="text-warning">Partial</span> | No `USING` clause | | E021-05 | OCTET_LENGTH function | <span class="text-danger">No</span> | `LENGTH` behaves similarly | | E021-06 | SUBSTRING | <span class="text-warning">Partial</span> | No support for `SIMILAR` and `ESCAPE` clauses, no `SUBSTRING_REGEX` variant | | E021-07 | Character concatenation | <span class="text-warning">Partial</span> | No `COLLATE` clause | | E021-08 | UPPER and LOWER functions | <span class="text-success">Yes</span> | | | E021-09 | TRIM function | <span class="text-success">Yes</span> | | | E021-10 | Implicit casting among the fixed-length and variable-length character string types | <span class="text-warning">Partial</span> | ANSI SQL allows arbitrary implicit cast between string types, while ClickHouse relies on functions having multiple overloads instead of implicit cast | | E021-11 | POSITION function | <span class="text-warning">Partial</span> | No support for `IN` and `USING` clauses, no `POSITION_REGEX` variant | | E021-12 | Character comparison | <span class="text-success">Yes</span> | | | E031 | Identifiers | <span class="text-warning">Partial</span>| | | E031-01 | Delimited identifiers | <span class="text-warning">Partial</span> | Unicode literal support is limited | | E031-02 | Lower case identifiers | <span class="text-success">Yes</span> | | | E031-03 | Trailing underscore | <span class="text-success">Yes</span> | | | E051 | Basic query specification | <span class="text-warning">Partial</span>| | | E051-01 | SELECT DISTINCT | <span class="text-success">Yes</span> | | | E051-02 | GROUP BY clause | <span class="text-success">Yes</span> | | | E051-04 | GROUP BY can contain columns not in `<select list>` | <span class="text-success">Yes</span> | | | E051-05 | Select items can be renamed | <span class="text-success">Yes</span> | | | E051-06 | HAVING clause | <span class="text-success">Yes</span> | | | E051-07 | Qualified \* in select list | <span class="text-success">Yes</span> | | | E051-08 | Correlation name in the FROM clause | <span class="text-success">Yes</span> | | | E051-09 | Rename columns in the FROM clause | <span class="text-danger">No</span> | | | E061 | Basic predicates and search conditions | <span class="text-warning">Partial</span> | | | E061-01 | Comparison predicate | <span class="text-success">Yes</span> | | | E061-02 | BETWEEN predicate | <span class="text-warning">Partial</span> | No `SYMMETRIC` and `ASYMMETRIC` clause |