Claudimir Zavalik escreveu: > 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 >
Veja esta thread no histórico: http://www.nabble.com/ordena%C3%A7%C3%A3o-e-libc---uma-poss%C3%ADvel-solu%C3%A7%C3%A3o-%28podem-me-ajudar-a-testar-%29-tf2468799.html#a6883324 é um problema da glibc (ignora o espaço em brnco entre os nomes). []s Osvaldo _______________________________________________________ Yahoo! Mail - Sempre a melhor opção para você! Experimente já e veja as novidades. http://br.yahoo.com/mailbeta/tudonovo/ _______________________________________________ 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
