COUNT(DISTINCT transaction_id) AS number_of_sales, COUNT(DISTINCT product_id) AS number_of_products, COUNT(DISTINCT store_id) AS number_of_stores WHEN date_format(transaction_time, 'HH:mm:ss') BETWEEN ...