如何在Sqlite中删除表与其他表的内连接? [英] How delete table inner join with other table in Sqlite?
本文介绍了如何在Sqlite中删除表与其他表的内连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的查询:
DELETE a FROM TR_ContactResultRecord a
INNER JOIN TR_Case b on (a.FireStationCode=b.FireStationCode and a.CaseNo=b.CaseCode )
WHERE b.Update_DateTime <=20140628134416
它显示错误:[Err] 1 - a"附近:语法错误
Sqlite 中如何删除表与其他表的内连接?
How delete table inner join with other table in Sqlite?
推荐答案
尝试使用子查询重写您的查询:如果您的 TR_ContactResultRecord
PK 是 CaseNo
Try to rewrite you query using subquery: In case your PK for TR_ContactResultRecord
is CaseNo
DELETE FROM TR_ContactResultRecord
WHERE CaseNo IN (
SELECT CaseNo FROM TR_ContactResultRecord a
INNER JOIN TR_Case b
ON (a.FireStationCode=b.FireStationCode and a.CaseNo=b.CaseCode )
WHERE b.Update_DateTime <=20140628134416
);
这篇关于如何在Sqlite中删除表与其他表的内连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文