为什么此更新查询无效。续集运行得很好,但它没有更新表

时间:2016-12-08 10:45:43

标签: mysql sql testing

我有一个查询,我正在运行以更新多个表但是相同的字段。我在下面提到了查询:

  

UPDATE itRoomsWeek1,itRoomsWeek2,itRoomsWeek3,itRoomsWeek4,itRoomsWeek5,itRoomsWeek6,itRoomsWeek7,itRoomsWeek8,itRoomsWeek9,itRoomsWeek10,itRoomsWeek11,itRoomsWeek12,itRoomsWeek13,itRoomsWeek14,itRoomsWeek15,itRoomsWeek16,itRoomsWeek17,itRoomsWeek18,itRoomsWeek19,itRoomsWeek20,itRoomsWeek21,itRoomsWeek22,itRoomsWeek23, itRoomsWeek24,itRoomsWeek25,itRoomsWeek26,itRoomsWeek27,itRoomsWeek28,itRoomsWeek29,itRoomsWeek30,itRoomsWeek31,itRoomsWeek32,itRoomsWeek33,itRoomsWeek34,itRoomsWeek35,itRoomsWeek36,itRoomsWeek37,itRoomsWeek38,itRoomsWeek39,itRoomsWeek40,itRoomsWeek41,itRoomsWeek42,itRoomsWeek43,itRoomsWeek44,itRoomsWeek45,itRoomsWeek46,itRoomsWeek47,itRoomsWeek48, itRoomsWeek49,itRoomsWeek50 SET itRoomsWeek1.A5 =' test',itRoomsWeek2.A5 =' test',itRoomsWeek3.A5 =' test' ,itRoomsWeek4.A5 =' test',itRoomsWeek5.A5 =' test',itRoomsWeek6.A5 =' test',itRoomsWeek7.A5 =' test&# 39;,itRoomsWeek8.A5 =' test',itRoomsWeek9.A5 =' test',itRoomsWeek10.A5 =' test',itRoomsWeek11.A5 =' test',itRoomsWeek12.A5 =' test',itRoomsWeek13.A5 =' test',itRoomsWeek14.A5 =' test',itRoomsWeek15.A5 =&# 39; test',itRoomsWeek16.A5 =' test',itRoomsWeek17.A5 =' test',itRoomsWeek18.A5 =' test',itRoomsWeek19.A5 = ' test',itRoomsWeek20.A5 =' test',itRoomsWeek21.A5 =' test',itRoomsWeek22.A5 =' test',itRoomsWeek23。 A5 =' test',itRoomsWeek24.A5 =' test',itRoomsWeek25.A5 =' test',itRoomsWeek26.A5 =' test', itRoomsWeek27.A5 =' test',itRoomsWeek28.A5 =' test',itRoomsWeek29.A5 =' test',itRoomsWeek30.A5 =' test&#39 ;,itRoomsWeek31.A5 =' test',itRoomsWeek32.A5 =' t est',itRoomsWeek33.A5 =' test',itRoomsWeek34.A5 =' test',itRoomsWeek35.A5 =' test',itRoomsWeek36.A5 =&# 39; test',itRoomsWeek37.A5 =' test',itRoomsWeek38.A5 =' test',itRoomsWeek39.A5 =' test',itRoomsWeek40.A5 = ' test',itRoomsWeek41.A5 =' test',itRoomsWeek42.A5 =' test',itRoomsWeek43.A5 =' test',itRoomsWeek44。 A5 =' test',itRoomsWeek45.A5 =' test',itRoomsWeek46.A5 =' test',itRoomsWeek47.A5 =' test', itRoomsWeek48.A5 =' test',itRoomsWeek49.A5 =' test',itRoomsWeek50.A5 =' test'在哪里' dayPeriod' =' MonP1'

1 个答案:

答案 0 :(得分:0)

您正在尝试更新itRoomsWeekxxitRoomsWeekxx.A5,列'dayPeriod' = 'MonP1'

由于字符串'dayPeriod''MonP1'不相等,因此无法进行更新。我想你的意思是:WHERE dayPeriod = 'MonP1'WHERE 'dayPeriod' = MonP1(无论你在哪个列名中设置条件)。

此外,设置一个列名不是由表名主持的条件......我不确定这是否有效。