sql select two orderids

Posted on 2010-01-05
Last Modified: 2012-05-08
select dateordered from orders where orderid = '7000149' & '7000150'
Question by:rgb192
    LVL 75

    Accepted Solution

    select dateordered from orders where orderid in ( '7000149' , '7000150' )
    LVL 92

    Assisted Solution

    by:Patrick Matthews
    select dateordered from orders where orderid = '7000149' or orderid = '7000150'
    LVL 22

    Assisted Solution

    Just to throw out another option: ;-)
    SELECT dateordered
    FROM orders
    WHERE orderid BETWEEN '7000149' AND '7000150'

    Open in new window

    LVL 40

    Assisted Solution

    Is your orderid an INT or BIGINT type?

    you can remove the quotes.

    select dateordered from orders where orderid in ( 7000149 , 7000150 )

    Author Closing Comment

    all work

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
    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.

    761 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

    10 Experts available now in Live!

    Get 1:1 Help Now