Am I trying to run a query, for example, an answer,
SQL Selecting multiple sums?
SELECT SUM(CASE WHEN order_date >= '01/01/09' THEN quantity ELSE 0 END) AS items_sold_since_date,
SUM(quantity) AS items_sold_total,
product_ID
FROM Sales
GROUP BY product_ID
But if I try, I get an error message
"message": "Unrecognized function CASE".
If I try a lot easier (from sql tutorial),
SELECT CASE 1 WHEN 1 THEN 'one' WHEN 2 THEN 'two' ELSE 'more' END;
Then i get
"message": "searched case expression not supported at: 1.8 - 1.65".
I'm going to take a wild hit in the dark and assume that the SQL CASE function as a whole is simply not supported on BigQuery, but I really hope I'm wrong because it makes a huge difference based on the report of the queries I want to run.
source
share