Skip to content

Query a specific value in a window

Use the nth_value function to query a specific value in a window.

SQL
* |
select
  __time__,
  nth_value(streamValue,2) over(
    PARTITION BY streamValue
    order by
      status desc
  ) as sallary_rank
order by
  streamValue,
  sallary_rank