How to get last 3 Months of "Monday to Sunday" dates In Redshift?
<p>How can I get last 3 Months of "Monday to Sunday" dates in Redshift?</p>

<pre><code>S.no    Start_dt    End_dt  week
1   18-Jul-16   24-Jul-16   Week1
2   25-Jul-16   31-Jul-16   Week2
3   1-Aug-16    7-Aug-16    Week3
4   8-Aug-16    14-Aug-16   Week4
5   15-Aug-16   21-Aug-16   Week5
6   22-Aug-16   28-Aug-16   Week6
7   29-Aug-16   4-Sep-16    Week7
8   5-Sep-16    11-Sep-16   Week8
9   12-Sep-16   18-Sep-16   Week9
10  19-Sep-16   25-Sep-16   Week10
11  26-Sep-16   2-Oct-16    Week11
12  3-Oct-16    9-Oct-16    Week12
13  10-Oct-16   16-Oct-16   Week13
</code></pre>

<p>I've tried this:</p>

<pre><code>select 
  trunc(date_trunc('week',sysdate)) st_dt,
  trunc(date_trunc('week', sysdate)+6) ed_dt,
  'week'||row_number() over (order by null) as week
</code></pre>

<p>but it only returns the current week's Monday and Sunday.</p>