Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SharkAl
Starting Member
8 Posts |
Posted - 2014-09-30 : 11:36:58
|
I want to search a table and display only results that contain particular Hotmail and yahoo email addresses. The code I am using currently is:Select Name, Email, PATINDEX('%Hotmail%, Email) From tblPersonHow do I search for more than one email domain? Do I use a case statement, if so how?Thanks in advance |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-09-30 : 11:49:25
|
Use the filter in a WHERE clause like this:SELECT Name, EMailFROM tblPersonWHERE Email LIKE '%hotmail%' OR Email LIKE '%yahoo%' |
|
|
SharkAl
Starting Member
8 Posts |
Posted - 2014-09-30 : 12:04:23
|
Brilliant Thanks James, that's worked |
|
|
|
|
|