【发布时间】:2013-03-23 01:20:09
【问题描述】:
如何查找/替换一个 table1.field3 中与另一个 table2.field2 匹配的所有值,使用 table2.field2 的循环,就像 table1.field1 中的通配符字符串匹配
类似的东西。
UPDATE productsTable.color
SET x = (
SET productsTable.Color = colorstable.`name`
WHERE productsTable.ShortDescription LIKE colorstable.%`nameOfColor`%';
)
【问题讨论】:
-
什么???请发布示例输入数据和输出数据。很难理解您的需求。
-
如果您正确构造查询,SQL 中很少需要循环。
标签: mysql