Get max of two query

Hi
i want to get MAX() of two query, as grafana with influx does not support MAX(MAX(deviceA), MAX(deviceB)).

Not able write query like MAX(#A,#B)