甲骨文插入多行



我的语句将插入四个学生 ID 中的两个。插入的是已存在且具有另一个节号的 Id。我不知道为什么没有插入其他两个。

INSERT INTO enrollment
    (student_id,section_id,enroll_date,created_by,created_date,modified_by,modified_date)
SELECT
    student_id,'48',SYSDATE,'KABEL',SYSDATE,'KABEL',SYSDATE
FROM enrollment
WHERE student_id IN ('375','137','266','382');

您的查询没有太大错误。您是拼写错误或错误地从一个表中选择了插入表和选择查询,因为这没有任何意义,从一个表中进行选择并插入到同一个表中。

使用同一表的选择和插入语句enrollment .

这应该是两个不同的表。

INSERT INTO enrollment <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-------Here Problem
  (student_id,section_id,enroll_date,created_by,created_date,
      modified_by,modified_date)
SELECT
    student_id,'48',SYSDATE,'KABEL',SYSDATE,'KABEL',SYSDATE
FROM enrollment   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-------Here Problem
WHERE student_id IN ('375','137','266','382');

最新更新