You are here: LIKE and IN can I combine « MsSQL Server « IT news, forums, messages
LIKE and IN can I combine

Posted by rcamarda on 10/10/05 15:59

I can use the IN with the WHERE clause as example:

SELECT * FROM NORTHWIND WHERE LASTNAME IN ('FULLER','KING')

I want to use the IN and LIKE at the same time:
SELECT * FROM NORTHWIND WHERE LASTNAME LIKE ('A%','B%')

I know this is a simplistic example, but the members for the IN will be
many, 5 to 10.
I'm trying to avoid:
SELECT * FROM NORTHWIND WHERE LASTNAME LIKE 'A%' OR LASTNAME LIKE 'B%'
OR LASTNAME LIKE 'FU%' OR LASTNAME LIKE 'JON%' <...>

and so forth.
Any Ideas?
TIA
Rob

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация