• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

Delete QUery Help Needed for items in multiple tables

Guidence needed on delete query.  I want to delete all items in table 1 that are in table 2.  
select * from table 1
table1 join on table2 table1.c#=table2.C# works. when I add delete * instead of the select it grumbles...

 
0
kat50
Asked:
kat50
  • 2
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
You don't need the * for delete, as you can't delete specific columns you can only delete the whole row.
0
 
Ephraim WangoyaCommented:
delete
from table1
where table1.c# in (select c# from table2)
0
 
Carl TawnSystems and Integration DeveloperCommented:
Even though you obviously completely ignored my comment, just thought i'd point out that using IN is a lot slower than using JOIN syntax.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now