Solved

Delete query

Posted on 2008-10-16
4
191 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
[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
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Optimize the query 5 50
Select values in a row based on values in another row in sql 4 31
Sql case statement to calculate totals 5 33
Problem with MySQL query - graph 3 23
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

763 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