Hope this will work for u

select distinct substring(name, 1,1) from test1 order by name asc ;

----- Original Message -----
From: "Kevin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 17, 2002 2:40 PM
Subject: query question


> 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