我正在尝试执行 OLE DB 命令,仅当同一个表中不存在主键字段时才向我的表中添加行。这是我到目前为止所拥有的:
insert into employee
(employee_id, first_name, middle_initial, last_name) /*fields of the employee table*/
values (employeedID, firstName, mInitial, lastName) /*columns from my input */
/* only insert into the table where employee_ID is not already in the table */
where ((select employee_id from employee where employee_id = employeeID) = NULL);
基本上我想要的只是一个条件插入语句。
谢谢!