Re: mysql regexp select questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, April 7, 2005 5:32 pm, Andras Kende said:
>
> I would like to do the following:
>
> ============
> mysql db:
>
> andrew
> anthony
> joe
> janice
> john
> simon
> ============
>
> sql_query ( select names .....
>
> ============
>
> I would need only the distinct first character from the query
> result would be: a,j,s
>
> I think maybe its REGEXP but never did it before...

select distinct substring(name, 1, 1) from names


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux