One possible solution can be:

```
SELECT StockID, MAX(run) AS longest_streak 
FROM (
    SELECT StockID, Date, Price, 
           ROW_NUMBER() OVER (PARTITION BY StockID ORDER BY Date) AS row_num,
           ROW_NUMBER() OVER (PARTITION BY StockID, Price ORDER BY Date) 
              - ROW_NUMBER() OVER (PARTITION BY StockID ORDER BY Date) AS run
    FROM stock_prices
) a
GROUP BY StockID, run
HAVING MIN(Price) <> MAX(Price)
ORDER BY StockID, longest_streak DESC;
```

This query uses three window functions to identify streaks of increasing stock prices: 

- `ROW_NUMBER()` assigns a row number to each price/date combination, grouping by StockID.
- `ROW_NUMBER()` assigns a row number to each price/date combination that has the same StockID and Price, grouping by Date in ascending order. This effectively assigns a group ID to each run of consecutive dates where the price remains the same.
- Subtracting these row numbers gives a unique identifier for each streak of consecutive dates where the price increases. 

Then, we group by StockID and the streak identifier (`run`), and count the length of each streak with `MAX(run)`. We filter out streaks where the price never changes with `HAVING MIN(Price) <> MAX(Price)`, and finally order by StockID and the length of the longest streak of increasing prices to get the desired result.
Data una tabella dei prezzi delle azioni con le colonne StockID, Date e Price, scrivi una query SQL per trovare la serie di giorni consecutiva più lunga in cui il prezzo di un'azione è aumentato, per ogni azione.