title: db2 sqlstate 42972 error
body: <p>I am getting this error when I am trying to execute this sql query</p>
  
  <pre><code>INSERT INTO
              AGG_QUALITY
      SELECT
              QIF.DATEDM_ID, 
              'Status' AS BREAKDOWN_TYPE, 
              HCR.VALUE, 
              QIF.SCANDEFINITION_ID, 
              QIF.QUALITYISSUE_VALUE, 
              COUNT(QIF.QUALITYISSUEFACT_ID), 
              COUNT(QRF.QUALITYRESOLUTIONFACT_ID)
  
      FROM
              QUALITYISSUEFACT QIF,
              HUBCODERECORD HCR,
              ITEMSTATUS ITS
      LEFT JOIN
              QUALITYRESOLUTIONFACT QRF
      ON
              QIF.QUALITYISSUEFACT_ID = QRF.QUALITYISSUEFACT_ID
      WHERE
              QIF.DATEDM_ID &gt; startDateDMId 
              AND     QIF.DATEDM_ID &lt;= endDateDMId    
              AND HCR.CODE = ITS.H_STATUS_TYPE
              AND QIF.DIMENSION_ROM_PK = ITS.ITEMMASTER_ID
      GROUP BY
              QIF.DATEDM_ID, HCR.VALUE, QIF.SCANDEFINITION_ID, QIF.QUALITYISSUE_VALUE
      ;
  </code></pre>
  
  <p>DB21034E  The command was processed as an SQL statement because it was not a 
  valid Command Line Processor command.  During SQL processing it returned:
  SQL0338N  An ON clause associated with a JOIN operator or in a MERGE statement 
  is not valid.  LINE NUMBER=31.  SQLSTATE=42972</p>