Solved

Delete query

Posted on 2008-10-16
4
189 Views
Last Modified: 2012-05-05
Getting msg Specify table you want to delete records from

DELETE Account_Num
FROM DSNB_Sp INNER JOIN LTR_3A_Status ON DSNB_Sp.Account_Num = LTR_3A_Status.F1
WHERE LTR_3A_Status.f2 = "C"

Thanx,
Trudye
0
Comment
Question by:Trudye
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22729727
any better with this?
DELETE LTR_3A_Status.*
FROM DSNB_Sp INNER JOIN LTR_3A_Status ON DSNB_Sp.Account_Num = LTR_3A_Status.F1
WHERE LTR_3A_Status.f2 = "C"

Open in new window

0
 
LVL 6

Accepted Solution

by:
divyeshhdoshi earned 500 total points
ID: 22729752
DELETE FROM DSNB_Sp d1
where d1.Account_Num in
                 (select  LTR_3A_Status.F1 from LTR_3A_Status WHERE LTR_3A_Status.f2 = "C"
                   )
0
 
LVL 6

Expert Comment

by:openshac
ID: 22729772
or just
DELETE
FROM DSNB_Sp INNER JOIN LTR_3A_Status ON DSNB_Sp.Account_Num = LTR_3A_Status.F1
WHERE LTR_3A_Status.f2 = "C"

Open in new window

0
 

Author Comment

by:Trudye
ID: 22756419
Thanks Guys for responding, sorry it took me soooo very long to get back to you, but I have been crazy busy.

Angel your solution did not work, I had errors, I put them aside to provide feedback but can't remember where I put them.
Divyeshdoshi, your solution worked like a charm.
Openshac, I just saw your solution so I'll have to pass on it. I am pretty sure that this solution requires a subquery.

Thanx again,
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running Total in Access 4 49
Access 2016 - query 23 62
Help Required 3 97
Sql Server group by 10 29
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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 …

803 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