我有两个页面管理员和教师。这两个页面有不同的网格视图。在我提交教师页面时,它使用已存储的旧值更新新值,但我想要旧的值以及更新的值在table.Only所选的值应该在database.upgest我一些查询。
UPDATE test
SET hour1 = CASE WHEN (@hour1)= 'true'
THEN @hour1
ELSE @hour1
END,
hour2 = CASE WHEN (@hour2)= 'true'
THEN @hour2
ELSE @hour2
END,
hour3 = CASE WHEN (@hour3)= 'true'
THEN @hour3
ELSE @hour3
END ,
hour4 = CASE WHEN (@hour4)= 'true'
THEN @hour4
ELSE @hour4
END ,
hour5 = CASE WHEN (@hour5)= 'true'
THEN @hour5
ELSE @hour5
END
WHERE datedif = @datedif
AND hour1 = 'true'
AND hour2 = 'true'
AND hour3 = 'true'
AND hour4 = 'true'
AND hour5 = 'true'