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 2005 Forums
 Transact-SQL (2005)
 Return list of first letters of a description fiel

Author  Topic 

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2010-09-21 : 09:33:02
HI all,

I want to query a table that has a nvarchar(50) description field
and I want a recordset of unique first letters, ignoring case.

So if the table looks like this:

Description
-----------
Alpha
bravo
Charlie
candy
andy
Zulu

I would get:

Letters
----------
A
B
C
Z

As an aside, I'm not familiar with but have run into the concept of 'full text search' or something like that when I was trying to
do a query using pattern matching. Apparently to support full text search (or whatever its called) something has to be done to the table or filed to support it - would that be a lot of extra overhead
to do and is it necessary to do what I want to do here?

Thanks,

kpg - I'm new here but this forum has already been a great help!

kpg

X002548
Not Just a Number

15586 Posts

Posted - 2010-09-21 : 09:46:58
SELECT DISTINCT UPPER(SUBSTRING('abc',1,1))

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx





Go to Top of Page

kpgraci
Yak Posting Veteran

68 Posts

Posted - 2010-09-21 : 10:13:30
Brilliant!

Works great, Thanks.

kpg
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-09-21 : 10:27:58
it was nothing...no really...nothing

http://msdn.microsoft.com/en-us/library/ms130214.aspx

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx





Go to Top of Page
   

- Advertisement -