我在从表A获取值并使用CASE语句更新到表B时遇到问题。我的CASE声明如下。我猜有一个语法错误:
$strSQLInsert2 = "UPDATE commercial_acc_cust SET pbg_curr =
CASE WHEN ('".$values["main_section"]."'='Bank Guarantee PBG') Then 'pbg_curr'
END
WHERE tender_id=" . $values["tender_id"];
答案 0 :(得分:1)
if($values["main_section"] == 'Bank Guarantee PBG'){
$strSQLInsert2 = "UPDATE commercial_acc_cust SET pbg_curr = 'pbg_curr'
WHERE tender_id=" . $values["tender_id"];
}