Olá pessoal...

estou rodando um select comum numa tabela e o "order by" não tá funcionando
legal...... alguém tem alguma sugestão ???

[]s
Claudimir Zavalik


 # select
codigo,nome,ascii(substr(nome,1,1)),ascii(substr(nome,2,1)),ascii(substr(nom
e,3,1)),ascii(substr(nome,4,1)),ascii(substr(nome,5,1)),ascii(substr(nome,6,
1)) from tabela where nome like 'LUCA%' order by nome;

 codigo |               nome               | ascii | ascii | ascii | ascii |
ascii | ascii
--------+----------------------------------+-------+-------+-------+-------+
-------+-------
   1342 | LUCA BONASPETTI CAPRARA          |    76 |    85 |    67 |    65 |
32 |    66
   2540 | LUCA PASQUETTI COMELLI FRITSCHER |    76 |    85 |    67 |    65 |
32 |    80
   2195 | LUCA QUEIROZ MOCELLIN            |    76 |    85 |    67 |    65 |
32 |    81
   1930 | LUCA SALDANHA SCHIFINO           |    76 |    85 |    67 |    65 |
32 |    83
    354 | LUCAS ALVES NUNES PATRON         |    76 |    85 |    67 |    65 |
83 |    32
   1597 | LUCAS AMORIM DE ALMEIDA          |    76 |    85 |    67 |    65 |
83 |    32
... várias outras linhas...
   2274 | LUCAS VARGAS SCHMIDT             |    76 |    85 |    67 |    65 |
83 |    32
   1375 | LUCAS WEBER                      |    76 |    85 |    67 |    65 |
83 |    32
   1376 | LUCAS WEBER                      |    76 |    85 |    67 |    65 |
83 |    32
   2308 | LUCA ZILIO DE OLIVEIRA           |    76 |    85 |    67 |    65 |
32 |    90
(47 registros)

Aquele último aparece sempre fora da ordem alfabética.... imprimi os códigos
ASC para validar se não havia algum caracter especial escondido, mas pelo
visto não há.

Estou usando PosgreSQL versão 7.4.5







_______________________________________________
Grupo de Usuários do PostgreSQL no Brasil
Antes de perguntar consulte o manual
http://pgdocptbr.sourceforge.net/

Para editar suas opções ou sair da lista acesse a página da lista em:
http://pgfoundry.org/mailman/listinfo/brasil-usuarios

Responder a