Query the minimum value in a window
Use the last_value function to query the minimum value in a window.
SQL
* |
select
__time__,
last_value(streamValue) over(
PARTITION BY streamValue
order by
status desc
) as sallary_rank
order by
streamValue,
sallary_rank