如果假设我想在一个sql查询中更新2行或更多行,我该怎么做呢?我目前的陈述如下:UPDATE PricePlan SET Price='" + GuestInput.Text + "' WHERE PricePlanName = 'Guest' THEN Price='" + MemberInput.Text + "' WHERE PricePlanName = 'Member'
最佳答案
像这样的东西应该行得通…你得稍微修改一下
"UPDATE PricePlan
SET price =
IIf(PricePlanName = 'Guest',"+ GuestInput.Text + ",
IIf(PricePlanName = 'Member',"+ MemberInput +"))"