Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql mariadb使用来自不同表的多个where条件进行更新_Sql_Sql Update_Mariadb - Fatal编程技术网

Sql mariadb使用来自不同表的多个where条件进行更新

Sql mariadb使用来自不同表的多个where条件进行更新,sql,sql-update,mariadb,Sql,Sql Update,Mariadb,我试图根据两个表中的条件更新表中的字段 update a, b set a.`value` = '1265' where a.`id` = b.`ID` and b.`type` = 'product' and a.`key` = '1234' 这将返回“0个受影响的行。”它应该可以工作。可能没有匹配的行要更新。@maSTArHiAn-是的。尽管我不喜欢基于逗号的样式,但这应该可以。也许字段区分大小写?a、 id=b。ID@nicas1您能发布您的数据吗?请为这两个表提

我试图根据两个表中的条件更新表中的字段

update a,
    b
set a.`value` = '1265'
where a.`id` = b.`ID`
    and b.`type` = 'product'
    and a.`key` = '1234'

这将返回“
0个受影响的行。

它应该可以工作。可能没有匹配的行要更新。@maSTArHiAn-是的。尽管我不喜欢基于逗号的样式,但这应该可以。也许字段区分大小写?a、 id=b。ID@nicas1您能发布您的数据吗?请为这两个表提供
SHOW CREATE TABLE