 <p>If it's not too late, I'd suggest implementing a <code>SEQUENCE</code> instead of counting. You may not get strict numeric order (there can be gaps), but you'll get a unique value every time:</p> <pre><code>CREATE SEQUENCE Config_Parm_Values_Seq START WITH &lt;1 + your current max ID&gt;; </code></pre> <p>Also note that your <code>INSERT</code> as it stands right now will behave as follows:</p> <ul> <li>If there are no records in the table, it will insert nothing.</li> <li>If there are records in the table, it will double the number of rows in your table every time you execute it.</li> </ul> <p>So, even if you don't use the sequence, I'd consider a "plain old" <code>INSERT</code> instead of an <code>INSERT ... SELECT</code>. This example uses the sequence:</p> <pre><code>insert into CONFIGURATION_PARAMETER_VALUES ( ID , NAME , DESCRIPTION , DATA_TYPE , VALUE_STRING , VALUE_INTEGER , VALUE_DATE , VALUE_FLOAT , VALUE_TIMESTAMP , APPLICATION_ID , DELETED ) VALUES ( Config_Parm_Values_Seq.NEXTVAL -- Use seqname.nextval to get -- the next value from the sequence , 'Alert_Statuses_AllExceptNoStatus' , 'Suspicious' , 'String' , 'RBS_EIM_AL_008' , null , null , null , null , (select MAX(ID) from APPLICATIONS where name = 'Rabobank v 1.0.0.0') , 'N') </code></pre>