MySQL Cursor Assistance

Job ID: 32814024

Budget: $10 – $30 USD

I have a table of data with products and prices from different companies at different points in time. I have a summary report for the the product at different points in time where i want to update the amount of companies and the average of the most recent price available.

I can write a Row over partition by to get the count and average price for a specific date but i can't seem to get the cursor to work to use the reporting date of the table I need to INSERT/UPDATE into.

Needs to be for MySQL
Flexible otherwise
Hope to use this for INSERT for new report dates and potentially updating if older info is added to Price data.