?
Solved

sql select two orderids

Posted on 2010-01-05
5
Medium Priority
?
337 Views
Last Modified: 2012-05-08
select dateordered from orders where orderid = '7000149' & '7000150'
0
Comment
Question by:rgb192
5 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 26182689
select dateordered from orders where orderid in ( '7000149' , '7000150' )
0
 
LVL 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 500 total points
ID: 26182693
select dateordered from orders where orderid = '7000149' or orderid = '7000150'
0
 
LVL 22

Assisted Solution

by:8080_Diver
8080_Diver earned 500 total points
ID: 26183427
Just to throw out another option: ;-)
SELECT dateordered
FROM orders
WHERE orderid BETWEEN '7000149' AND '7000150'

Open in new window

0
 
LVL 41

Assisted Solution

by:Sharath
Sharath earned 500 total points
ID: 26184092
Is your orderid an INT or BIGINT type?

you can remove the quotes.

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

Author Closing Comment

by:rgb192
ID: 31673058
all work
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

864 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