I have a table with product, cost, date for every day of the year eg

```
prod1, 1, 01/01/2020    
prod1, 1, 02/01/2020    
prod1, 2, 03/01/2020   
prod1, 2, 04/01/2020   
prod1, 1, 05/01/2020  
prod1, 1, 06/01/2020

```

how can I generate a query to produce me the product, the cost and the date each one appears first and last in sequence for EVERY change ie not

```
prod1, 1, 01/01/2020 first, 06/01/2020 last 
prod1, 2, 03/01/2020 first, 04/01/2020 last 

```

but

```
prod1, 1, 01/01/2020 first, 01/01/2020 last 
prod1, 2, 02/01/2020 first, 04/01/2020 last 
prod1, 1, 05/01/2020 first, 06/01/2020 last 

```

I know it must be something to do with an OVER clause but am struggling with how that is working for me

NB there are multiple products

Any help much appreciated