title: Query returns last 11 fiscal years as rows. Can I get use LISTAGG() to convert it to a comma separated list?
body: <p>I have composed this query to return the last 11 fiscal years:</p>
  
  <pre><code>SELECT TO_NUMBER(EXTRACT(YEAR FROM ADD_MONTHS(SYSDATE,+3)))-LEVEL+1 
  FROM DUAL CONNECT BY LEVEL &lt;= 11;
  </code></pre>
  
  <p>It returns the following:</p>
  
  <p><a href="https://i.stack.imgur.com/tlk1d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tlk1d.png" alt="enter image description here"></a></p>
  
  <p>I would like to convert it to a comma-separated VARCHAR2, as follows:</p>
  
  <p><code>'2019,2018,2017,2016,2015,2014,2013,2012,2011,2010,2009'</code></p>
  
  <p>Is there a way to use <code>LISTAGG()</code> for this? Or any other suggestions for a straight PL/SQL query (i.e., a <code>SELECT</code> statement; without a <code>DECLARE BEGIN END;</code> block)?</p>
  
  <p>Thanks!</p>