BigQuery

Fungsi SQL BigQuery

Data warehouse serverless dari Google Cloud. 220 fungsi tersedia.

Menampilkan 24 dari 220 fungsi

TIME

Date & Time

Creates a TIME value from components, or extracts the TIME portion from a timestamp or datetime.

Tipe hasil: TIME

TIMESTAMP

Date & Time

Creates a TIMESTAMP value from a string, DATE, or DATETIME. TIMESTAMP values are always stored in UTC.

Tipe hasil: TIMESTAMP

TIMESTAMP_ADD

Date & Time

Adds a time interval to a TIMESTAMP value. The result remains in UTC.

Tipe hasil: TIMESTAMP

TIMESTAMP_DIFF

Date & Time

Calculates the difference between two TIMESTAMP values in the specified unit. Most accurate for measuring absolute durations.

Tipe hasil: INT64

TIMESTAMP_MICROS

Conversion

Mengkonversi Unix timestamp (microseconds) ke TIMESTAMP.

Tipe hasil: TIMESTAMP

TIMESTAMP_MILLIS

Conversion

Mengkonversi Unix timestamp (milliseconds) ke TIMESTAMP.

Tipe hasil: TIMESTAMP

TIMESTAMP_SECONDS

Conversion

Mengkonversi Unix timestamp (seconds) ke TIMESTAMP.

Tipe hasil: TIMESTAMP

TIMESTAMP_SUB

Date & Time

Subtracts a time interval from a TIMESTAMP value. The inverse of TIMESTAMP_ADD.

Tipe hasil: TIMESTAMP

TIMESTAMP_TRUNC

Date & Time

Truncates a TIMESTAMP to the specified granularity. Supports timezone for accurate local-time results.

Tipe hasil: TIMESTAMP

TIME_ADD

Date & Time

Adds a time interval to a TIME value. Useful for work-hour calculations and scheduling.

Tipe hasil: TIME

TIME_DIFF

Date & Time

Calculates the difference between two TIME values in the specified unit.

Tipe hasil: INT64

TIME_SUB

Date & Time

Subtracts a time interval from a TIME value. The inverse of TIME_ADD.

Tipe hasil: TIME

TIME_TRUNC

Date & Time

Truncates a TIME value to the specified granularity (MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR).

Tipe hasil: TIME

TO_CODE_POINTS

String

Converts a STRING or BYTES value into an array of code points (Unicode code points for STRING, values 0-255 for BYTES).

Tipe hasil: ARRAY<INT64>

TO_JSON

JSON

Converts a BigQuery value to the native JSON type.

Tipe hasil: JSON

TO_JSON_STRING

JSON

Converts a BigQuery value to a JSON string representation.

Tipe hasil: STRING

TRANSLATE

String

Replaces each character from the source character set with the corresponding character in the target character set. Character-level translation.

Tipe hasil: STRING

TRIM

String

Removes characters from the beginning and end of a string. By default, removes whitespace.

Tipe hasil: STRING

TRUNC

Math

Truncates a number to the specified precision without rounding (truncation toward zero).

Tipe hasil: Same as input type

UNIX_DATE

Conversion

Mengkonversi DATE ke jumlah hari sejak 1970-01-01.

Tipe hasil: INT64

UNIX_MICROS

Conversion

Mengkonversi TIMESTAMP ke Unix timestamp dalam mikrodetik.

Tipe hasil: INT64

UNIX_MILLIS

Conversion

Mengkonversi TIMESTAMP ke Unix timestamp dalam milidetik.

Tipe hasil: INT64

UNIX_SECONDS

Conversion

Mengkonversi TIMESTAMP ke Unix timestamp dalam detik.

Tipe hasil: INT64

UNNEST

Array

Mengubah array menjadi set of rows (flatten array).

Tipe hasil: Table of T