I'm looking to create a table that fills in with data from other tables however I have to fill the first field with an incrementing value. I have posted my current statement below that does not work. It seems to put in different numbers in each field instead of 1-30.
INSERT into 'era_proj_actuals' (id1, prog_id, serv_cat, oneyrcontract_id, oneyrstartdt, oneyrenddt, conno, serv_enc, serv_clients) SELECT RECNO() as id1, projections.prog_id, projections.serv_cat, projections.oneyrcontract_target_id, contract_targets.startdate, contract_targets.enddate, ai_contract.conno, projections.serv_enc, projections.serv_clients FROM projections INNER JOIN contract_targets ON projections.oneyrcontract_target_id = contract_targets.oneyrcontract_target_id INNER JOIN ai_contract ON contract_targets.contract_id = ai_contract.ai_contract_id
INSERT into 'era_proj_actuals' (id1, prog_id, serv_cat, oneyrcontract_id, oneyrstartdt, oneyrenddt, conno, serv_enc, serv_clients) SELECT RECNO() as id1, projections.prog_id, projections.serv_cat, projections.oneyrcontract_target_id, contract_targets.startdate, contract_targets.enddate, ai_contract.conno, projections.serv_enc, projections.serv_clients FROM projections INNER JOIN contract_targets ON projections.oneyrcontract_target_id = contract_targets.oneyrcontract_target_id INNER JOIN ai_contract ON contract_targets.contract_id = ai_contract.ai_contract_id