Solved

Delete query

Posted on 2008-10-16
4
190 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 143

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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 …

829 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