use examples; create table measurements( m_id int primary key, m_time datetime, m_value float); INSERT INTO measurements (m_id, m_time, m_value) VALUES (1, '2023-06-15 10:50:35', 35.2), (2, '2023-06-15 20:37:41', 80.99), (3, '2023-06-15 19:02:02', 90.4), (4, '2023-06-15 17:18:46', 75.6), (5, '2023-06-15 21:21:17', 17.59), (6, '2023-06-15 05:26:28', 69.35), (7, '2023-06-15 20:57:40', 83.27), (8, '2023-06-15 21:03:13', 24.46), (9, '2023-06-15 09:04:17', 46.93), (10, '2023-06-15 05:51:05', 82.74); #Write a query to obtain the sum of odd_numbered measurements and the sum of the even numbered #measurements by date for the measurements table WITH measurements_by_count AS ( SELECT cast(m_time as date) m_day, m_value, row_number() Over (PARTITION by cast(m_time as date) order by m_time ASC) as m_count FROM measurements ) SELECT m_day, SUM( if (m_count % 2 !=0, m_value,0)) as odd_sum, SUM( if (m_count % 2 =0, m_value,0)) as even_sum FROM measurements_by_count GROUP by m_day ORDER by m_day ASC;