我正在尝试使用
case
插入
这是我使用的代码,但是
elseif ( exists(select id from transactions where tel = last_inserted_number && secure_using_payslip IS NULL)) then
update transactions set secure_using_payslip=last_inserted_message where
tel=last_inserted_number;
insert into messageout(messagetext, messageto)
values("you choose not to secure with payslip.", last_inserted_number),(case when last_inserted_message = 'no');
insert into messageout(messagetext, messageto)
values("you choose to secure with payslip.", last_inserted_number),(case when last_inserted_message = 'yes');
insert into messageout(messagetext, messageto)
values("Are you formally employed or self employed?.", last_inserted_number);
代码失败。我应该如何在这里使用case?。