Solved

Delete query

Posted on 2013-02-07
3
151 Views
Last Modified: 2013-02-07
I would like to delete codes from 1 table that do not exist in another but not sure how to do that.

Table1 UploadforcedMatches (delete [vrr_vehicleid]) from this table
Table2 TblExportVinstems where vrr_vehicleID does not exist in here
0
Comment
Question by:PeterBaileyUk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 400 total points
ID: 38863493
You've almost written the sql in prose there!!

DELETE FROM UploadforcedMatches
 WHERE NOT EXISTS
    (SELECT vrr_vehicleID                                        
   FROM TblExportVinstems
   WHERE TblExportVinstems .InvoiceID = UploadforcedMatches .vrr_vehicleID);
 
Backup before testing.
0
 
LVL 61

Accepted Solution

by:
mbizup earned 100 total points
ID: 38863500
Pete's got the SQL you need, but an easy way to do this through the query designer is to create a SELECT query that pulls the records that you want to delete, and then right-click the query builder window --> query type -->Delete Query
0
 

Author Closing Comment

by:PeterBaileyUk
ID: 38863586
thx guys, yes i tried writing psuedocodish to assist.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question