Quantcast
Viewing all articles
Browse latest Browse all 15628

[RESOLVED] SQLite: delete all records from table that do not exist in another table

Hello VbForums
With SQLite and RC5 how can I delete records from table1 that do not exist in table2?
Image may be NSFW.
Clik here to view.
Name:  225.jpg
Views: 72
Size:  30.4 KB

So the rows which are concered with deleetion are in yellow.
This is what I'm trying to do but without success.
Code:

DELETE FROM Tbl2 " & _
" WHERE PID IN (SELECT Tbl2.PID FROM recette_tbl LEFT JOIN Tbl1 " & _
" ON Tbl2.PID=Tbl1.PID WHERE Tbl1.PID IS NULL)"

Attached Images
Image may be NSFW.
Clik here to view.
 

Viewing all articles
Browse latest Browse all 15628

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>