Skip to content
Advertisement

Tag: google-bigquery

BigQuery: JOIN on single matching row

I have two tables, one containing orders with a nested line_items structure and another with a pricing history for each product sku code. Orders Table order_id order_date item_sku item_quantity item_subtotal 1 2022-23-07 SKU1 7 12.34 SKU2 1 9.99 2 2022-12-07 SKU1 1 1.12 SKU3 5 32.54 Price History Table item_sku effective_date cost SKU1 2022-20-07 0.78 SKU2 2022-02-03 4.50 SKU1 2022-02-03

Big Query Error When Using CAST and determining decimals

I have linked a Big Query Project to my Google Ads Account. Within that, we have a campaignBasicStats table. I want to pull the cost of a campaign from my Google Ads account into a big query workspace to apply some additional logic. The cost column is coming through as an INTEGER and is described like this: INTEGER NULLABLE The

How do I extract the string after 0: in big query sql

I want to extract extract “f9sdsdsd-1375-41f7-8c4c-ereb20ad3843c” from “0:f9696a03-1375-41f7-8c4c-34b20ad3843c”. I am currently using TRIM(REGEXP_EXTRACT(“0:f9696a03-1375-41f7-8c4c-34b20ad3843c”, r”0:[^:]+)”)) . However, I am not getting being able to extract it with the current syntax. Can someone please help me here? Thanks. Answer you are just simply missing ( – use below

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 itself. Is this just reserved for future usage or do any SQL statements contain that as a keyword? Answer Just

Starting and Ending a row-count based on values in another column

There is a need to monitor the performance of a warehouse of goods. Please refer to the table containing data for one warehouse below: WK_NO: Week number; Problem: Problem faced on that particular week. Empty cells are NULLs. I need to create the 3rd column: Weeks on list: A column indicating the number of weeks that a particular warehouse is

Advertisement