By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,266 Members | 1,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,266 IT Pros & Developers. It's quick & easy.

Delete Statement

P: 6
I need a delete statement to delete records using the below select statement. I got a mind block as to what should be used in the where clause column operator.

Expand|Select|Wrap|Line Numbers
  1. DELETE from InvOnHand
  2. WHERE <unknown column operator>
  3. (SELECT InvOnHand.*
  4. FROM   InvMaster Join InvOnHand On InvMaster.partno = InvOnHand.partno
  5. WHERE  InvMaster.category = 'bag' and DatePart(yyyy, transdate) between 2004 and 2007 and NOT (InvOnHand.partno in (partlist))
  6.  
Expand|Select|Wrap|Line Numbers
  1. SELECT InvOnHand.*
  2. FROM   InvMaster Join InvOnHand On InvMaster.partno = InvOnHand.partno
  3. WHERE  InvMaster.category = 'bag' and DatePart(yyyy, transdate) between 2004 and 2007 and NOT (InvOnHand.partno in (partlist))
  4.  
Jan 22 '09 #1
Share this Question
Share on Google+
1 Reply


P: 6
What through me off was the first optional keyword "from". Got r done.


Expand|Select|Wrap|Line Numbers
  1. DELETE InvOnhand
  2. FROM InvMaster Join InvOnHand On InvMaster.partno = InvOnHand.partno
  3. WHERE  InvMaster.category = 'bag' and DatePart(yyyy, transdate) between 2004 and 2007
  4.       and NOT (InvOnHand.partno in (partlist)
  5.  
  6.  
Jan 22 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.