Skip to content

Instantly share code, notes, and snippets.

@AlexPashley
Created July 3, 2013 21:53
Show Gist options
  • Save AlexPashley/5923186 to your computer and use it in GitHub Desktop.
Save AlexPashley/5923186 to your computer and use it in GitHub Desktop.
SQL: exclude "The", "An, "A" from results list
SELECT artist_name
FROM artists
ORDER BY TRIM(
LEADING "A "
FROM TRIM(
LEADING "An "
FROM TRIM(
LEADING "The "
FROM LOWER( artist_name ) ) ) )
LIMIT 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment