【发布时间】:2015-05-20 00:07:26
【问题描述】:
我的数据库中有 40,000 行需要更新。但是,我使用的选择查询跨越两个表。
我的选择查询示例如下:
select t1.*, t2.data, t2.more_data, t2.more_data2
from table1 as t1, table2 as t2
where
DATE(t1.date) >= '2014-10-23'
and
t1.direction = 10
and
t1.date_read is NULL
and
t1.fk_client is NULL
and
t1.id=t2.id
and
t2.data = 'this is dummy text';
我一直在查看其他人对此的要求,但我似乎无法理解它。
编辑:
我想要做的是用2015-03-17 09:00:00 更新t1.date_read,其中t2.data 等于'this is dummy test'
【问题讨论】:
-
您要更新哪些列以及使用什么值?
-
那么你的问题是什么?
-
没有
t3表在您的t3.more_data2的查询中声明 -
我可以看到您的查询存在多个问题...
SELECT中缺少.,日期和数据字段中缺少右引号,缺少表引用 (t3),不寻常的 @ 987654330@ 对名为 date 的列进行强制转换,使用已被弃用 20 多年的JOIN语法...但是您的问题到底是什么? -
字符串以单引号开头,但结尾引号不存在