我有以下查询:
select count(*)
FROM
cumul AS t1,
cumul AS t2
WHERE
t1.id+1 = t2.id
and
t2.spec_datetime-t1.spec_datetime < 0.001
and
t1.id < 100000
and
t1.v1-t2.v1 = 0
and
t1.v2-t2.v2 =0;
我想删除相同的记录:
DELETE FROM cumul AS t1, cumul AS t2
WHERE
t1.id+1 = t2.id
and
t2.spec_datetime-t1.spec_datetime < 0.001
and
t1.v1-t2.v1 = 0
and
t1.v2-t2.v2 = 0;
我得到:
ERROR 1064 (42000):您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 'AS t1 , cumul AS t2 WHERE t1.id+1 = t2.id 和 t2.spec_datetime-t1.spec_datetime <' 附近使用正确的语法
如何更正查询?