Last active
December 16, 2015 21:21
-
-
Save thiago-vieira/5499258 to your computer and use it in GitHub Desktop.
Select para fazer paginação pela primeira letra do nome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT first_letter FROM (SELECT DISTINCT SUBSTR(nome,0,1) as first_letter FROM PESSOAS) WHERE first_letter IN('A','B', 'C') ORDER BY first_letter | |
-- É bom fazer um link extra para buscar por nomes que não comecem por nenhuma das letras incluídas no IN. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment