SELECT brand, SUM(DATEDIFF(end_time, start_time) + 1) AS promotion_days FROM your_table GROUP BY brand;