title: Sql query that outputs last minute data
body: <p>Good day everyone, I solve this problem. We need to display data on statuses 200 and 500 for the last minute from clickhouse to our grafana monitor.</p>
  <p>I expect this request to work and output last minute data, but as soon as I enter it into the monitor on Grafana, it throws a &quot;request error&quot;</p>
  <pre><code>&quot;100 - (sum(StatusRes != '200'[1m]) * 100),
   100 - (sum(StatusRes == '200'[1m]) * 100),&quot;
  </code></pre>
  <p>Also tried like this:</p>
  <pre><code>SELECT
      $ timeSeries as t,
      StatusRes,
      sum (StatusRes == '200') * 100 / (StatusRes == '500'),
      Provider
  FROM $ table
  
  WHERE $ timeFilter
  
  GROUP BY
      t,
      StatusRes,
      Provider
  ORDER BY
      t,
      StatusRes,
      Provider
  </code></pre>