Advertisement

11.08.2004 at 06:51AM PST, ID: 21198447
[x]
Attachment Details

DELETE on an INNER JOIN - is it possible?

Asked by lunchboxbill in MS SQL Server

Tags: , ,

Hi,

I am using a SQL Server 2000 DB, interrogated by Enterprise manager.

I can SELECT as:

SELECT      c_AnswerMutli.*
FROM       c_Applicant
INNER JOIN c_AnswerMulti ON c_Applicant.id = c_AnswerMulti.applicantid
WHERE           (c_Applicant.vacancyrefno = 667 OR
                c_Applicant.vacancyrefno = 408 OR
                c_Applicant.vacancyrefno = 464 OR
                c_Applicant.vacancyrefno = 465 OR
                c_Applicant.vacancyrefno = 466 OR
                c_Applicant.vacancyrefno = 467 OR
                c_Applicant.vacancyrefno = 468 OR
                c_Applicant.vacancyrefno = 469 OR
                c_Applicant.vacancyrefno = 470 OR
                c_Applicant.vacancyrefno = 471 OR
                c_Applicant.vacancyrefno = 666 OR
                c_Applicant.vacancyrefno = 437 OR
                c_Applicant.vacancyrefno = 438 OR
                c_Applicant.vacancyrefno = 462)
AND       (c_Applicant.status = 7 OR c_Applicant.status = 11)

But I cant do the same for a DELETE

i.e

DELETE      c_AnswerMutli.*
FROM       c_Applicant

etc etc

Is this possible???? I have about 20,000 records to go through, so manually deleting them is not an option.

If I do a SELECT it wont let me delete more than 2 at a time (thats if I'm lucky)

Help me please!!!

Thanks.

Start Free Trial
 
 
[+][-]11.08.2004 at 07:01AM PST, ID: 12523746

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.08.2004 at 07:02AM PST, ID: 12523757

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: delete, join, inner
Sign Up Now!
Solution Provided By: Lowfatspread
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32