根据参考 ID 删除行

发布于 2024-11-05 09:04:53 字数 471 浏览 2 评论 0原文

我正在开发一个 AIR 应用程序,该应用程序使用本地 SQL lite DB 来存储信息,然后在每天结束时将数据发布到服务器上的 MySQL DB。数据按用户会话成组发布。数据发布后,我需要根据会话 ID 删除与该会话关联的所有行。我读过这个网站上的很多帖子,也看到了很多方法来做到这一点 - 不幸的是,我几乎没有成功让它们在 SQL lite Manager 中运行 - 在将其放入操作脚本代码之前,我一直在其中进行测试。以下是这样的一种尝试:

DELETE vendor_interest
  FROM vendor_interest v
INNER JOIN screen_view s on s.id = v.screen_view_id
                        and s.session_id = 44

screen_view 表引用了会话 ID 和vendor_interest 表,我在其中尝试删除与会话关联的所有行。

I am working on an AIR application that uses a local SQL lite DB to store information before it posts the data to a MySQL DB on the server at the end of each day. The data is posted in sets by user sessions. Once the data has posted i need to delete all rows associated with that session based on the session id. I have read many posts on this site and seen many ways to do this - unfortunately i have had little success getting them to run in SQL lite Manager - where i have been testing before i place it into the actionscript code. the following is one such attempt:

DELETE vendor_interest
  FROM vendor_interest v
INNER JOIN screen_view s on s.id = v.screen_view_id
                        and s.session_id = 44

The screen_view table has the reference to the session ID and to the vendor_interest table where i am trying to delete all the rows associated with the session.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

写给空气的情书 2024-11-12 09:04:53

你可以尝试这样的事情:

DELETE FROM vendor_interest 
WHERE screen_view_id IN (SELECT id FROM screen_view WHERE session_id = 44); 

You can try something like this:

DELETE FROM vendor_interest 
WHERE screen_view_id IN (SELECT id FROM screen_view WHERE session_id = 44); 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文