title: for looping in sql developer
body: <p>Again there is a outrageously freaking error..</p>
  
  <blockquote>
    <p>not a single-group group function</p>
  </blockquote>
  
  <p>I have got an empty table <code>mig_temp1</code>, which I want to fill with observations))
  what is wrong about this select??</p>
  
  <pre><code>begin
    for j in 1..7 loop 
      for t in 0..32 loop
        insert into mig_temp1 (report_date, portfolio, bucket, Q)
        select add_months(to_date('31.10.2014','DD.MM.YYYY'),-t),
               cp.portfolio, j, count(*)
          from proba_cft pr, credtoportfolio cp
         where pr.credit_num = cp.credit and pr.dpd_47 between 30*(j-1)+1 and 30*j;
      end loop;
    end loop;
  end;
  </code></pre>