Solved

sql Query

Posted on 2009-05-10
2
193 Views
Last Modified: 2012-05-06
How can I rewrite the select statement without using IN


SELECT *
 

FROM dbo.tblcustomers
 

WHERE custstate IN ('CA','MI','WA')

Open in new window

0
Comment
Question by:iolike
2 Comments
 
LVL 1

Accepted Solution

by:
asitkaushik earned 500 total points
ID: 24349197
SELECT *
 
FROM dbo.tblcustomerss
 
WHERE (custstate ='CA' )OR (custstate ='MI') OR (custstate ='WA')
 
This can be one of an alternate query
0
 

Author Closing Comment

by:iolike
ID: 31579943
Thanks, it worked
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

16 Experts available now in Live!

Get 1:1 Help Now