The MAX value query for time span

Hello
I need your help.
I have very little knowledge of querys and would like to start a query with “node-RED” to determine the maximum value of the last 2 days.
I think I already have the first part right, but now I don’t know how to tell the query that I only want the max value and not all values. Everything runs on one and the same machine.

SELECT mean(“value”) FROM “0_userdata.0.Heizung.Gastherme.Vorlauf” WHERE time >= now() - 2d and time <= now() GROUP BY time(5m)