select din,driv_height,city,Driver_Addres_Posta_Code,DRIV_GENDER_ID from driv_testing
if
DRIV_GENDER_ID IN('M','F')
begin
insert into driv_success
end
else DRIV_GENDER_ID not in ('M','F')
begin
insert into error_logs(error_description) values('Gender fails')
end
我有一个源表driv_testing和接收器表driv_success和error_logs表用于记录不良记录。
如果DRIV_GENDER_ID IN('M','F')然后我要插入driv_success,否则要插入error_logs表。
但是上述查询出现错误。
从driv_test中选择din,driv_height,city,Driver_Addres_Posta_Code,DRIV_GENDER_ID,如果DRIV_GENDER_ID IN('M','F')开始插入driv_success结束,否则DRIV_GENDER_ID不在('M','F')开始...