如果让我说我想在单个SQL查询中更新2行或更多行,我该怎么办呢?我目前的陈述不起作用如下:
UPDATE PricePlan SET Price='" + GuestInput.Text + "' WHERE PricePlanName = 'Guest' THEN Price='" + MemberInput.Text + "' WHERE PricePlanName = 'Member'
答案 0 :(得分:2)
这样的东西应该有用......你需要稍微修改一下
"UPDATE PricePlan
SET price =
IIf(PricePlanName = 'Guest',"+ GuestInput.Text + ",
IIf(PricePlanName = 'Member',"+ MemberInput +"))"