我需要根据来自另一个表的查询值更新表,逻辑如下: 我需要选择具有代表服务器的数字的列残差:
Select [resid] from [dbo].[dailyChecksIntegrityErrorState2]
然后我需要说
if [resid] ='1077'
然后
update [dbo].[DailyChecks] set prdintegritycheckbox ='0'
我知道这是一个新问题,我需要一些指导如何制定if then / else语句
答案 0 :(得分:0)
这应该有效
my_array = [["A", 10],["A", 5],["B", 5],["B", 5],["C", 15],["C", 15]]
my_hash = {}
output_array = []
my_array.each do |item|
my_hash[item[0]] ||= 0
my_hash[item[0]] += item[1]
end
my_hash.each do |k,v|
output_array.push("(#{k} : #{v})")
end
puts output_array.join(" - ")
答案 1 :(得分:0)
你似乎想要这样的东西:
case "$1-$2" in
"zune-tohere")
toex="$rsync$remotemus$localmus"
;;
...
esac
或:
update dc
set prdintegritycheckbox = '0'
from [dbo].[DailyChecks] dc
where dc.server in (Select [resid] from [dbo].[dailyChecksIntegrityErrorState2] where resid = '1077')