access_time 2 months ago languageEnglish
more_vert

BigQuery SQL - COALESCE and IFNULL Functions

visibility 16 comment 0

Similar as other databases, BigQuery also supports a large number of SQL dialects. COALESCE and IFNULL functions are provided to deal with nullable values.

COALESCE

SELECT
  coalesce(NULL,
    1,
    2) as Col;
Output (in JSON format):
[
  {
    "Col": "1"
  }
]

IFNULL

SELECT
  ifnull(NULL,
    1) AS Col;
Output (in JSON format):
[
  {
    "Col": "1"
  }
]
copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Follow Kontext

Get our latest updates on LinkedIn or Twitter.

Want to contribute on Kontext to help others?

Learn more

More from Kontext

visibility 215
thumb_up 0
access_time 5 months ago
Load JSON File into BigQuery
visibility 33
thumb_up 0
access_time 1 month ago