如何从选择加入语句中删除结果
如何从下面的“选择加入语句”中删除结果。
SELECT
t2.TransactionID
FROM
TableA AS t1
INNER JOIN
TABLEB AS t2 ON t1.TransactionID = t2.TransactionID
WHERE
t2.accountingDate BETWEEN '2010-01-01 00:00:00.0000000' AND '2011-12-30 00:00:00.0000000'
How do I delete the result from the Select Join statement below.
SELECT
t2.TransactionID
FROM
TableA AS t1
INNER JOIN
TABLEB AS t2 ON t1.TransactionID = t2.TransactionID
WHERE
t2.accountingDate BETWEEN '2010-01-01 00:00:00.0000000' AND '2011-12-30 00:00:00.0000000'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜您想要的是过滤出不需要的结果,您可以在选择查询中使用“不在”,例如过滤掉'id1'和'id2',就像以下内容:
I guess what you want is filter out the result not needed, you can use "Not in" in your select query, for example filter out 'id1' and 'id2' like following:
据我了解您的问题,您正在问如何从两个表中删除结果集。在SQL语句的上下文中,您不能。 SQL删除语句仅作用于单个表。您必须进行2次删除,首先删除“ Tablea”记录,然后再删除“ TableB”记录。
As I understand your question, you're asking how to delete the result set from both tables. Within the context of a SQL statement, you can't. A sql delete statement only acts on a single table. You'll have to do 2 deletes, first deleting the 'TableA' record, then the 'TableB' record.