Logical aggregates
The last set of special aggregate functions you will use are the logical operators LOGICAL_AND
and LOGICAL_OR
. These provide an efficient way to find if any data set contains a true boolean. This helps when grouping by data to quickly see if all or one of those values is true
. For example, this exercise will look at groups of data to see if they have been delivered or if at least one of the values has been delivered.
Este ejercicio forma parte del curso
Introduction to BigQuery
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
-- Complete the query using LOGICAL_AND
SELECT
customer_id,
-- Fill in the LOGICAL_AND function
___ as all_delivered
FROM ecommerce.ecomm_order_details
GROUP BY customer_id;