删除具有内部联接的行?

编程入门 行业动态 更新时间:2024-10-28 04:18:37
本文介绍了删除具有内部联接的行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个带有两个表的SQLITE数据库.表A具有一个整数时间戳,另一个整数列包含一个行ID,该行ID引用表B中具有两个时间戳的行.

I have a SQLITE database with two tables. Table A has an integer timestamp and another integer column containing a row id referring to a row in table B which has two timestamps.

我想删除表A中时间戳不在表B中两个时间戳之间并且ROWID等于X的所有行.

I want to delete all rows in table A where it's timestamp does not lie between the two timestamps in table B, and the ROWID is equal to X.

这是我目前所拥有的,但是出现语法错误:

Here is what I have at the moment but I am getting a syntax error:

DELETE FROM network WHERE ROWID in ( SELECT ROWID FROM track INNER JOIN network ON (track.ROWID = network.trackId) WHERE network.timestamp > track.stopTime OR network.timestamp < track.startTime AND network.trackId = X

推荐答案

对于子选择,您没有右括号.试试这个:

You don't have a closing parenthesis for your subselect. Try this:

DELETE FROM network WHERE ROWID in ( SELECT ROWID FROM track INNER JOIN network ON (track.ROWID = network.trackId) WHERE network.timestamp > track.stopTime OR network.timestamp < track.startTime AND network.trackId = X )

如果这不起作用,请尝试发布您的实际语法错误.

If that doesn't work, try posting your actual syntax error.

更多推荐

删除具有内部联接的行?

本文发布于:2023-10-15 00:40:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492721.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!