Mysql 更新查询不工作占记录的7-8%

Mysql 更新查询不工作占记录的7-8%,mysql,Mysql,我想这并不容易。 我有一个简单的更新查询,效果很好,问题是7-8%的记录没有更新。似乎左连接不能总是与ON子句匹配 我已经检查了不匹配的字段,看看是否有一些空白,但没有。我还检查了左表中的重复项,这里也没有。 当然,我还检查了这两个表中是否存在记录 我在Windows10下使用MySQL 8.0 这是我的代码: UPDATE `61_LoadUnit` LEFT JOIN `statistics`.`tbl_g08t1` ON `61_LoadUnit`.`StUnit` =

我想这并不容易。 我有一个简单的更新查询,效果很好,问题是7-8%的记录没有更新。似乎左连接不能总是与ON子句匹配

我已经检查了不匹配的字段,看看是否有一些空白,但没有。我还检查了左表中的重复项,这里也没有。 当然,我还检查了这两个表中是否存在记录

我在Windows10下使用MySQL 8.0

这是我的代码:

  UPDATE `61_LoadUnit`
    LEFT JOIN `statistics`.`tbl_g08t1`
    ON `61_LoadUnit`.`StUnit` = `statistics`.`tbl_g08t1`.`ecarrno`
    SET `61_LoadUnit`.`carrno` = `statistics`.`tbl_g08t1`.`carrno`
    WHERE `61_LoadUnit`.`carrno` IN (NULL, 0);
StUnit=29318284
的一些数据。对不起,我不知道如何粘贴表格

61_装载单元
61_装载装置
thead tr{背景色:ActiveCaption;颜色:CaptionText;}
th,td{垂直对齐:顶部;字体系列:“Tahoma”,Arial,Helvetica,无衬线;字体大小:8pt;填充:3px;}
表,td{边框:1px纯银;}
表{边框折叠:折叠;}
thead.col0{宽度:64px;}
thead.col1{宽度:89px;}
thead.col2{宽度:83px;}
thead.col3{宽度:90px;}
thead.col4{宽度:52px;}
thead.col5{宽度:51px;}
thead.col6{宽度:35px;}
thead.col7{宽度:35px;}
thead.col8{宽度:89px;}
thead.col9{宽度:95px;}
thead.col10{宽度:83px;}
.col10{文本对齐:右;}
thead.col11{宽度:88px;}
.col11{文本对齐:右;}
thead.col12{宽度:157px;}
thead.col13{宽度:67px;}
thead.col14{宽度:71px;}
thead.col15{宽度:70px;}
.col15{文本对齐:右;}
thead.col16{宽度:87px;}
.col16{文本对齐:右;}
thead.col17{宽度:147px;}
thead.col18{宽度:83px;}
分部
确认书
再灌注
WCS_LoadId
MHA
架子
X
Y
眩晕
重量(单位:LW61)
卡诺
短62
零件号
帕特里夫
分区码
量
partwght
创作时间
运行日期
WCS1
0
10762181
10762181
ID1
AKS22282
482
32614650
166540
RB-12.7/G16VX310A
AKS
54000
0.008454
2019-08-29T14:52:09Z
20190830
WCS1
0
10762178
10762178
ID1
799197533
126.20
32577072
223198
PER.UCFX12A-A
33 47 
479PBE
15
5.8
2019-08-29T14:51:49Z
20190830
WCS1
0
10762172
10762172
ID1
29318284
223.80
2019-08-29T14:51:29Z
20190830
tbl_g08t1
tbl_g08t1
thead tr{背景色:ActiveCaption;颜色:CaptionText;}
th,td{垂直对齐:顶部;字体系列:“Tahoma”,Arial,Helvetica,无衬线;字体大小:8pt;填充:3px;}
表,td{边框:1px纯银;}
表{边框折叠:折叠;}
thead.col0{宽度:87px;}
.col0{text align:right;}
thead.col1{宽度:91px;}
.col1{文本对齐:右;}
thead.col2{宽度:77px;}
.col2{text align:right;}
thead.col3{宽度:69px;}
.col3{文本对齐:右;}
thead.col4{宽度:66px;}
.col4{文本对齐:右;}
thead.col5{宽度:74px;}
.col5{文本对齐:右;}
thead.col6{宽度:50px;}
.col6{文本对齐:右;}
thead.col7{宽度:71px;}
.col7{文本对齐:右;}
thead.col8{宽度:62px;}
.col8{文本对齐:右;}
thead.col9{宽度:46px;}
.col9{文本对齐:右;}
thead.col10{宽度:62px;}
.col10{文本对齐:右;}
thead.col11{宽度:64px;}
thead.col12{宽度:54px;}
thead.col13{宽度:65px;}
thead.col14{宽度:65px;}
thead.col15{宽度:56px;}
thead.col16{宽度:63px;}
thead.col17{宽度:70px;}
.col17{文本对齐:右;}
thead.col18{宽度:63px;}
.col18{文本对齐:右;}
thead.col19{宽度:62px;}
.col19{text align:right;}
thead.col20{宽度:69px;}
.col20{文本对齐:右;}
thead.col21{宽度:87px;}
.col21{文本对齐:右;}
thead.col22{宽度:69px;}
.col22{文本对齐:右;}
thead.col23{宽度:93px;}
.col23{文本对齐:右;}
thead.col24{宽度:138px;}
thead.col25{宽度:138px;}
thead.col26{宽度:138px;}
thead.col27{宽度:110px;}
thead.col28{宽度:135px;}
thead.col29{宽度:58px;}
.col29{文本对齐:右;}
thead.col30{宽度:62px;}
.col30{文本对齐:右;}
thead.col31{宽度:66px;}
.col31{文本对齐:右;}
thead.col32{宽度:56px;}
.col32{text align:right;}
thead.col33{宽度:54px;}
.col33{文本对齐:右;}
thead.col34{宽度:58px;}
.col34{文本对齐:右;}
thead.col35{宽度:92px;}
thead.col36{宽度:92px;}
thead.col37{宽度:92px;}
thead.col38{宽度:69px;}
.col38{文本对齐:右;}
thead.col39{宽度:108px;}
thead.col40{宽度:60px;}
.col40{文本对齐:右;}
thead.col41{宽度:65px;}
.col41{文本对齐:右;}
thead.col42{宽度:71px;}
.col42{文本对齐:右;}
thead.col43{宽度:71px;}
.col43{文本对齐:右;}
thead.col44{宽度:73px;}
.col44{文本对齐:ri
UPDATE `61_LoadUnit`
INNER JOIN `statistics`.`tbl_g08t1`
ON `61_LoadUnit`.`StUnit` = `statistics`.`tbl_g08t1`.`ecarrno`
SET `61_LoadUnit`.`carrno` = `statistics`.`tbl_g08t1`.`carrno`
WHERE `61_LoadUnit`.`carrno` IS NULL OR `61_LoadUnit`.`carrno` = 0
WHERE COALESCE(`61_LoadUnit`.`carrno`, 0) = 0
UPDATE `61_LoadUnit`
    INNER JOIN `statistics`.`tbl_g08t1`
    ON `61_LoadUnit`.`StUnit` = `statistics`.`tbl_g08t1`.`ecarrno`
    SET `61_LoadUnit`.`carrno` = `statistics`.`tbl_g08t1`.`carrno`
    WHERE `61_LoadUnit`.`carrno` IN (NULL, 0);