Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15819

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

$
0
0
Hello VbForums
With SQLite and RC5 how can I delete records from table1 that do not exist in table2?
Name:  225.jpg
Views: 24
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
 

Viewing all articles
Browse latest Browse all 15819

Trending Articles



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