Re: SELECT and regular expression
- From: "Tony Rogerson" <tonyrogerson@xxxxxxxxxxxxxxxx>
- Date: Mon, 24 Apr 2006 21:38:40 +0100
Hang on Martin, you didn't ask for that.
Whats your actual requirement?
You can use true regular expressions by using CLR function written in say C#
/ VB.NET.
LEFT( account, 1 ) IN ( .... )
The LIKE is more performant because it can better use an index.
--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Martin Lukasik" <marcin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:26bee$444cf727$c1263429$26427@xxxxxxxxxxxx
"Tony Rogerson" <tonyrogerson@xxxxxxxxxxxxxxxx> wrote in message
news:e2isig$2qt$1$8300dec7@xxxxxxxxxxxxxxxxxxx
where ( account like 'EB%
or account like 'NB%' )
and ( account like 'E0%
or account like 'N0%' )
and len( account ) between 6 and 7
Thank you,
Is there any easier way?
What if first characters are A, D, C, 4, X, Z, Y? It's not really nice to
type every permutation.
There must be some regular expression...
Martin
.
- References:
- SELECT and regular expression
- From: Martin Lukasik
- Re: SELECT and regular expression
- From: Tony Rogerson
- Re: SELECT and regular expression
- From: Martin Lukasik
- SELECT and regular expression
- Prev by Date: Re: SELECT and regular expression
- Next by Date: Re: SELECT and regular expression
- Previous by thread: Re: SELECT and regular expression
- Next by thread: Re: SELECT and regular expression
- Index(es):
Relevant Pages
|