You are here: Re: SELECT and regular expression « MsSQL Server « IT news, forums, messages
Re: SELECT and regular expression

Posted by Tony Rogerson on 04/24/06 18:58

where ( account like 'EB%
or account like 'NB%' )
and ( account like 'E0%
or account like 'N0%' )
and len( account ) between 6 and 7

--
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials


"Martin Lukasik" <marcin@milea.pl.i.hate.this.spam> wrote in message
news:68f2$444cf0e4$c1263429$24018@ZOO.CO.UK...
> Hi,
>
> I'm not a big friend of MSSQL, but I have to do one query I've done for
> mySQL.
> But I don't know how...
>
> I have to select 'user' from 'db' where first letter is E or N, second is
> B or 0 and after that there are 6 or 7 digits I know.
> How can I do that?
>
> In mySQL it would be something like:
>
> SELECT * FROM `table` WHERE `account` regexp '^[EN][B0]123456$' ORDER BY
> `Id`;
>
>
> Thanks in advance,
> Martin
>
>

 

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

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