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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 query help

Author  Topic 

cognos79
Posting Yak Master

241 Posts

Posted - 2007-08-22 : 17:56:38
I have a column: NAME. I need to find the all the names starting with letters A until M. Do i have to use regular expressions???

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-22 : 18:04:07
Are "m" names included?
SELECT * FROM Table1 WHERE Name >= 'a' AND Name < 'n' -- mcdonalds included
SELECT * FROM Table1 WHERE Name >= 'a' AND Name < 'm' -- mcdonalds excluded



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

uday.sql
Starting Member

3 Posts

Posted - 2007-08-23 : 18:44:37
This is also good.

SELECT * FROM Table1 WHERE Name LIKE '[A-M]%'
Go to Top of Page
   

- Advertisement -