快速提问,我确实尝试过谷歌但找不到答案。
我在这里有 3 个单独的查询,我想做SET IN ('price1', 'price2', 'price3')
但是当我尝试时出现错误。我该怎么做?
Update apotable
set price1 = '0.00'
where po_number IN ('x', 'y', 'z')
Update apotable
set price2 = '0.00'
where po_number IN ('x', 'y', 'z')
Update apotable
set price3 = '0.00'
where po_number IN ('x', 'y', 'z')
Run Code Online (Sandbox Code Playgroud)
Update apotable
set price1 = 0,
price2 = 0,
price3 = 0
where po_number IN ('x', 'y', 'z');
Run Code Online (Sandbox Code Playgroud)
请注意,数字不应括在单引号中0
是数字,'0.00'
是字符文字(又名“字符串”)。
无需在网络上搜索 SQL 语句的语法。
这都记录在手册中:https :
//msdn.microsoft.com/en-us/library/ms177523.aspx