小编dar*_*500的帖子

Deleting value using SQlite while doing an INNER JOIN

I am trying to delete all voters from a voters table where they are not registered as a democrat or republican AND only voted once. I have a database with three tables, congress_members, voters, and votes and have to JOIN votes with voters in order to delete the right data.

This code finds the data I want to delete:

SELECT voters.*
FROM voters JOIN votes ON voters.id = votes.voter_id
WHERE party = 'green' OR party = 'na' OR party = …
Run Code Online (Sandbox Code Playgroud)

sql sqlite join sql-delete

4
推荐指数
2
解决办法
4327
查看次数

标签 统计

join ×1

sql ×1

sql-delete ×1

sqlite ×1