Solved

Delete query

Posted on 2008-10-16
4
187 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]
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now