Hi,

Try

SELECT distinct substring(name, 1, 1) from names;

That should work :)

-Dan

On Wed, 16 Oct 2002, Kevin wrote:

> Hello,
> 
> I have a table with a list of names. I need to get a distinct list of the
> names by first letter, as follows:
> 
> John
> Mary
> Mark
> Tom
> 
> the query should return the following:
> 
> J
> M
> T
> 
> 
> Is there any way to this with a single query?
> 
> TIA
> 
> -Kevin
> [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to