mysql get first letter of a column from a table
Let’s say you have a store table in your database and you want to get the first letter of each store’s name. So you can create a menu by first letter of each store name and not having a letter that contains no stores.
$stores = $this->Store->find('all',array( 'order'=>'name ASC', 'fields'=>'DISTINCT(UPPER(LEFT(name,1))) AS letter', 'conditions'=>array("UPPER(LEFT(name,1)) REGEXP '[A-Z]'")));


