How to Combine LIKE and IN



SQL Server 2005.

I want to do a query that will accomplish both a LIKE type search and an IN
type search. I have a variable number of LIKE strings that I want to search
on. I know I can say:

SELECT * FROM <TABLE> WHERE <FIELD> LIKE '0001%' AND <FIELD> LIKE '0002%'
AND <FIELD> LIKE '0003%'

Is there a way to shorten this select statement and still accomplish the
same search? Thanks for any help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
.



Relevant Pages

  • Re: Help with while ...loop Statements
    ... The user enter a Sales Order Number ... my function send a insert and update statement to a Pervasive SQL Server. ... I am been able to accomplish it by running a Make Table Query (this query ...
    (microsoft.public.access.gettingstarted)
  • Re: Show results whilst processing
    ... You probably need to program asynchronously against SQL Server in order to accomplish that. ... do that depends on what database API you are using. ... Note, however, that SQL Server can decide to do intermediate processing of a query, like sorting ...
    (microsoft.public.sqlserver.server)
  • grouping for query example on pages 123-4 of your book
    ... I've been trying for hours to modify the Theater Freq probablility prediction query on pages 123-4 of Data Mining with SQL Server 2005 to accomplish two changes: ... Instead of the query returning results just for customers with Theater Freq values of Monthly and Rarely, I would like it to return results for those who are Weekly, Daily, and Never, too. ...
    (microsoft.public.sqlserver.datamining)
  • Link Tables
    ... , I can create a query that joins ... How can I accomplish this inside SQL Server? ... Bill ...
    (microsoft.public.sqlserver.dts)
  • Link SQL Server Tables
    ... , I can create a query that joins ... How can I accomplish this inside SQL Server? ... Bill ...
    (microsoft.public.sqlserver.dts)