I have the following SQL statement that retrieves the distinct first letter for each entry in the database. I'm using this to build a alphabetized list for a glossary.
PHP Code:
SELECT DISTINCT LEFT(art_title,1) AS first_letter FROM articles ORDER BY first_letter ASC
The problem I'm having is when the first letter in the string is a quote, single quote or some other character.
Is there a way in the SQL statement to replace any unwanted characters.
Cheers
Wayne.
|