title: Redshift with Grafana - ERROR: This type of correlated subquery pattern is not supported due to internal error
body: <p>I am facing with a query done on Redshift from Grafana where on adding a specific where clause, the above mentioned error is coming. Without this where clause, it is doing fine. Also, if we put a direct value say where first_week &gt; 2, then no error is coming.</p>
  <p>where clause:</p>
  <p><code>WHERE first_week &gt;= EXTRACT(YEAR FROM $__timeFrom AT TIME ZONE 'UTC')</code></p>
  <pre><code>    from  
      (select a.distinct_id, a.login_week, b.first_week as first_week, a.login_week 
      first_week as week_number 
      from (select distinct_id, EXTRACT(WEEK FROM timestamp AT TIME ZONE 'UTC') AS login_week from posthog_event where distinct_id IN ( select distinct_id from activated_user) group by 1, 2) a, 
      select distinct_id, MIN(EXTRACT(WEEK FROM timestamp AT TIME ZONE 'UTC')) AS first_week from posthog_event where distinct_id IN ( select distinct_id from activated_user) group by 1) b 
      where a.distinct_id = b.distinct_id
         ) as with_week_number 
         where first_week&gt;= EXTRACT(YEAR FROM '2022-03-01T17:01:18Z' AT TIME ZONE 'UTC')
         group by first_week order by first_week
  </code></pre>
  <p>Any idea where I am going wrong ? Or what could be done to get the where clause added.</p>