BigQuery

Fungsi SQL BigQuery

Data warehouse serverless dari Google Cloud. 220 fungsi tersedia.

Menampilkan 24 dari 220 fungsi

ABS

Math

Returns the absolute (positive) value of a numeric input.

Tipe hasil: Same as input type

ACOS

Math

Menghitung arc cosinus (inverse cosine) - sudut dalam radian yang memiliki cosinus x.

Tipe hasil: FLOAT64

ANY_VALUE

Aggregate

Returns one value from a group non-deterministically. Useful for retrieving a value from a column that is not being aggregated when all values in the group are the same.

Tipe hasil: Same as input type

APPROX_COUNT_DISTINCT

Aggregate

Estimates the number of distinct values using the HyperLogLog++ algorithm. Much faster and less resource-intensive than COUNT(DISTINCT) for large datasets.

Tipe hasil: INT64

APPROX_QUANTILES

Aggregate

Calculates approximate quantile boundaries from numeric data. Uses an efficient approximate algorithm for large datasets, returning an array with n+1 elements.

Tipe hasil: ARRAY<T>

APPROX_TOP_COUNT

Aggregate

Returns the approximate most frequently occurring elements along with their counts. Uses a highly efficient approximate algorithm for large datasets.

Tipe hasil: ARRAY<STRUCT<value T, count INT64>>

APPROX_TOP_SUM

Aggregate

Returns the approximate elements with the highest total weight. Similar to APPROX_TOP_COUNT but ranked by sum of weights rather than count.

Tipe hasil: ARRAY<STRUCT<value T, sum INT64>>

ARRAY

Array

Creates an array from a subquery or literal elements.

Tipe hasil: ARRAY<T>

ARRAY_AGG

Aggregate

Collects values from multiple rows into an ARRAY. A powerful BigQuery function for building nested data structures.

Tipe hasil: ARRAY<T>

ARRAY_CONCAT

Array

Concatenates two or more arrays into a single array.

Tipe hasil: ARRAY<T>

ARRAY_CONCAT_AGG

Aggregate

Concatenates multiple arrays into a single array. Useful when each row already contains an array and you want to merge them all into one.

Tipe hasil: ARRAY<T>

ARRAY_IS_DISTINCT

Array

Mengecek apakah semua elemen dalam array adalah unik (tidak ada duplikat).

Tipe hasil: BOOL

ARRAY_LENGTH

Array

Returns the number of elements in an array.

Tipe hasil: INT64

ARRAY_REVERSE

Array

Membalik urutan elemen dalam array.

Tipe hasil: ARRAY<T>

ARRAY_TO_STRING

Array

Joins array elements into a string using a delimiter.

Tipe hasil: STRING

ASCII

String

Returns the ASCII value (code point) of the first character in the string.

Tipe hasil: INT64

ASIN

Math

Menghitung arc sinus (inverse sine) - sudut dalam radian yang memiliki sinus x.

Tipe hasil: FLOAT64

ATAN

Math

Menghitung arc tangen (inverse tangent) - sudut dalam radian yang memiliki tangen x.

Tipe hasil: FLOAT64

ATAN2

Math

Menghitung arc tangen dari y/x dengan mempertimbangkan kuadran. Lebih akurat dari ATAN(y/x).

Tipe hasil: FLOAT64

AVG

Aggregate

Calculates the average (mean) of numeric values in a column. Ignores NULL values and supports multiple numeric types in BigQuery.

Tipe hasil: FLOAT64

BIT_AND

Aggregate

Performs a bitwise AND operation across all values in a group. Returns a value where each bit is 1 only if all input values have that bit set to 1.

Tipe hasil: INT64

BIT_COUNT

Math

Menghitung jumlah bit yang bernilai 1 dalam representasi binary.

Tipe hasil: INT64

BIT_OR

Aggregate

Performs a bitwise OR operation across all values in a group. Returns a value where each bit is 1 if at least one input value has that bit set to 1.

Tipe hasil: INT64

BIT_XOR

Aggregate

Performs a bitwise XOR operation across all values in a group. Returns a value where each bit is 1 if the number of input values with that bit set to 1 is odd.

Tipe hasil: INT64