Sum duration of individual events by SQL for the current day (*-1d) and the current week (*-7d) grouped by asset.

I want to sum duration of individual events by SQL for the current day (*-1d) and the current week (*-7d) grouped by asset.

Event frame names start with "KOI." and the Asset Type is "KOI_Para"


image.png
Example of SQL query result:


image_1.png
Can you help me write an SQL query?

Regards,

Igor