Delete multiple items

Posted on 2012-09-18
Last Modified: 2012-09-18
Hi Experts

I am Very, very new to SQL and need a bit of help.  I need to create a delete statement that
can handle multiple items in the wholesaleID.  Here is the statement that I use
when I am deleting 1 condition at a time.  Very time consuming.  

FROM [NYP-RetailDataSQL].dbo.[Sales-Compare918A]
WHERE WholesaleID = '99-MW' AND [Data Date] = '2012-09-11'

I would like to also delete 12-MW, 14-MA, 22-SW, 30-MA, 88-SW which are wholesaleID's.  
Is there a way to incorporate these items into the single item statement so that I am not having to go back change it one at a time?

Much thanks

Question by:spudmcc
    LVL 9

    Accepted Solution

    This might work:

    FROM [NYP-RetailDataSQL].dbo.[Sales-Compare918A]
    WHERE (WholesaleID IN ('99-MW', '12-MW', '14-MA', '22-SW', '30-MA', '88-SW') )
       AND [Data Date] = '2012-09-11'

    Author Closing Comment

    Perfect.  Thanks so much for the quick response and your time.  


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    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…
    How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now