INT
Syntax
INT( expression )
Description
Converts the expression expression to integer format according to the following rules:
| Type | Value |
|---|---|
Integer |
Original value. |
Fractional number |
Integer part of the number (rounded down). |
Date | Datetime |
Unix time |
String |
A number from a decimal string. |
Boolean |
TRUE — 1, FALSE — 0. |
Argument types:
expression—Boolean | Date | Datetime | Fractional number | Integer | String
Return type: Integer
Examples
INT(7.7) = 7
INT("365") = 365
INT(TRUE) = 1
Data source support
ClickHouse 21.8, Files, Google Sheets, Microsoft SQL Server 2017 (14.0), MySQL 5.7, Oracle Database 12c (12.1), PostgreSQL 9.3, Yandex Documents, YDB.