title: get the data starting from 1st month till current date in oracle sql
body: <p>I have written below query which is working fine and its getting the data everytime for every previous one week. </p>
  
  <pre><code>    select t.day_id 
      from F_TIME t 
      where t.day_id &gt;= TO_NUMBER (TO_CHAR( TRUNC ( SYSDATE , ''IW'' ) - 7 , ''YYYYMMDD'' )) 
                        and t.day_id &lt;  TO_NUMBER ( TO_CHAR ( TRUNC ( SYSDATE , ''IW'' ), ''YYYYMMDD'' ))
  </code></pre>
  
  <p>But now i want to rewrite this query in such a way that it will always get data starting from 1st of month till sysdate. So for example if i run this query now i should get data from 1st January 2018 till 11th January 2018.</p>
  
  <p>If i run this query on 1st Febrauary then it will return data for entire month of January.I am not sure whether its possible to do in single query.</p>
  
  <p>The dayid is number datatype and in format for e.g 20170815</p>