Group by range of values in bigquery
问题 Is there any way in Bigquery to group by not the absolute value but a range of values? I have a query that looks in a product table with 4 different numeric group by's. What I am looking for is an efficient way to group by in a way like: group by "A±1000" etc. or "A±10%ofA". thanks in advance, 回答1: You can generate a column as a "named range" then group by the column. As an example for your A+-1000 case: with data as ( select 100 as v union all select 200 union all select 2000 union all