Insert into Select query返回重复的行

时间:2017-06-08 14:39:37

标签: c++ sql oracle oracle-sqldeveloper oracle12c

INSERT INTO INT_TBL_2 (product_id, UR_id, lang_code, country_code, named_obj_class,     
                       named_obj_phonemes, total_phonemes, total_named_objects)
SELECT product_id, UR_id, lang_code, country_code, named_obj_class, 
       SUM(named_obj_phonemes), SUM(total_phonemes), SUM(total_named_objects) 
FROM INT_TBL_1 
WHERE named_obj_class = "city" 
GROUP BY product_id, UR_id, lang_code, country_code, named_obj_class

我的查询会在Oracle开发人员手动运行时生成正确的结果。但是,当通过C ++代码调用时,相同的查询会产生重复5000次的结果。

请注意,表INT_TBL_2在插入之前始终为空(新创建)。

0 个答案:

没有答案