10 July 2013

This snippet shows you how to select discinct first letters of titles. After getting the first letters you might want to transliterate the characters, you can do it in mysql by custom function where it's done by string replace.

Source code viewer
  1. SELECT DISTINCT LEFT(title,1) as letter FROM node WHERE type LIKE 'article' AND language LIKE 'en' AND status = 1 ORDER BY letter ASC
Programming Language: MySQL