Skip to content

Tag: google-cloud-platform

CURRENT in BigQuery?

I’ve noticed that CURRENT is a reserved keyword for BigQuery at: https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical. What exactly does CURRENT do? I’ve only seen it as a prefix for things such as CURRENT_TIME(), CURRENT_DATE(), and other such stuff but have never seen it by itse…

Compare two columns in SQL

I’m new to SQL and have very basic queries in GCP. Let’s consider this table below: Name B C Arun 1234-5678 1234 Tara 6789 – 7654 6789 Arun 4567 4324 Here, I want to compare column B and C and if they match then give 1 else 0 in column same and else different (which we have to create). So

ROW type/constructor in BigQuery

Does BigQuery have the concept of a ROW, for example, similar to MySQL or Postgres or Oracle or Snowflake? I know it sort of implicitly uses it when doing an INSERT … VALUES (…) , for example: Each of the values would be implicitly be a ROW type of the Inventory table, but is this construction all…

How to change arrays into rows

There is a table in BigQuery that contains 2 REPEATED(arrays) type of columns, enterded_date and status. Table in BigQuery: Is it possible to make a query that returns rows instead? Like this: Answer Consider below approach if applied to sample data in your question – output is