Solved

Seach for more that one value in one SQL database column

Posted on 2014-07-30
1
172 Views
Last Modified: 2014-07-30
I need to search a SQL server database table search for more than one value in a specific column....Example

SELECT tblEmployees where ZipCode = ('99201' and or '99202' and or '99202').......

Return all records who have a zip code of either 99201, 99202 and or 99202

Im not sure what the syntax would be.

Any help will be appreciated
0
Comment
Question by:Mike_Stevens
1 Comment
 
LVL 3

Accepted Solution

by:
Mark Olsen earned 500 total points
ID: 40229609
Try the "IN" clause:

SELECT tblEmployees where ZipCode IN ('99201', '99202', '99202');

Open in new window

0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 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