BigQuery

Fungsi SQL BigQuery

Data warehouse serverless dari Google Cloud. 220 fungsi tersedia.

Menampilkan 24 dari 220 fungsi

DATE

Date & Time

Creates a DATE value from individual components, or extracts a DATE from a timestamp or datetime expression.

Tipe hasil: DATE

DATETIME

Date & Time

Creates a DATETIME value from components, combines a DATE and TIME, or converts from a TIMESTAMP.

Tipe hasil: DATETIME

DATETIME_ADD

Date & Time

Adds a time interval to a DATETIME value. Supports all units from MICROSECOND to YEAR.

Tipe hasil: DATETIME

DATETIME_DIFF

Date & Time

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

Tipe hasil: INT64

DATETIME_SUB

Date & Time

Subtracts a time interval from a DATETIME value. The inverse of DATETIME_ADD.

Tipe hasil: DATETIME

DATETIME_TRUNC

Date & Time

Truncates a DATETIME value to the specified granularity. Supports all date parts from MICROSECOND through YEAR.

Tipe hasil: DATETIME

DATE_ADD

Date & Time

Adds a specified time interval to a DATE. Returns a new DATE.

Tipe hasil: DATE

DATE_DIFF

Date & Time

Calculates the difference between two DATE values in the specified unit. Returns an integer value.

Tipe hasil: INT64

DATE_FROM_UNIX_DATE

Conversion

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

Tipe hasil: DATE

DATE_SUB

Date & Time

Subtracts a specified time interval from a DATE. Returns a new DATE.

Tipe hasil: DATE

DATE_TRUNC

Date & Time

Truncates a DATE to the specified granularity (DAY, WEEK, MONTH, QUARTER, YEAR).

Tipe hasil: DATE

DEGREES

Math

Mengkonversi sudut dari radian ke derajat.

Tipe hasil: FLOAT64

DENSE_RANK

Window

Memberikan peringkat untuk setiap baris tanpa gap. Baris dengan nilai sama mendapat peringkat sama, peringkat berikutnya langsung +1.

Tipe hasil: INT64

DIV

Math

Performs integer division (floor division), discarding the remainder.

Tipe hasil: INT64 or NUMERIC

ENDS_WITH

String

Checks whether a string ends with a specified suffix. Returns a boolean.

Tipe hasil: BOOL

EXP

Math

Calculates e raised to the power of the expression (e^x), where e ≈ 2.71828.

Tipe hasil: FLOAT64

EXTRACT

Date & Time

Extracts a specific component from a DATE, TIME, DATETIME, or TIMESTAMP value. Returns an integer.

Tipe hasil: INT64

FARM_FINGERPRINT

String

Menghitung fingerprint menggunakan algoritma FarmHash. Sangat cepat dan cocok untuk BigQuery.

Tipe hasil: INT64

FIRST_VALUE

Window

Returns the first value in the window frame for each row.

Tipe hasil: Same as input expression

FLOOR

Math

Rounds a number down to the nearest integer less than or equal to the input.

Tipe hasil: Same as input type

FORMAT

String

Formats values into a string based on a format string (similar to printf). Supports a wide range of format specifiers.

Tipe hasil: STRING

FORMAT_DATE

Date & Time

Formats a DATE value into a string based on the specified format. Uses standard format elements.

Tipe hasil: STRING

FORMAT_DATETIME

Date & Time

Formats a DATETIME value into a string. Combines format elements for both date and time.

Tipe hasil: STRING

FORMAT_TIME

Date & Time

Formats a TIME value into a string based on the specified format.

Tipe hasil: STRING