Take tab (tab) of varchar

2

Good afternoon everyone! I'm trying anyway, but I can not seem to get a tab at the end of a varchar in firebird. Does anyone know how to do it?

Thanks in advance.

Editing to stay more specific:

Ex:

    select guia, convenio, nome, trim(matricula) from tabela  where guia = '142'

    group by guia, convenio, nome, trim(matricula)

o Result

    142 | 1 | Nome do paciente | 111222
    142 | 1 | Nome do paciente | 111222

However, if I remove the field registration, which is a varchar (40) that is with the tabs:

    select guia, convenio, nome from tabela  where guia = '142'

    group by guia, convenio, nome

The result is:

   142 | 1 | Nome do paciente 

And as I discovered that the problem was enrollment:

With the help of this function: Char_Length (enrollment)

    select guia, convenio, nome, Char_Length(matricula) from tabela  where guia = '142'

    group by guia, convenio, nome, matricula

The result:

    142 | 1 | Nome do paciente | 111222 | 6
    142 | 1 | Nome do paciente | 111222 | 10
    
asked by anonymous 09.02.2017 / 19:35

2 answers

0

I got it as follows:

trim(both from replace(campo, ascii_char(9), ' '))

Thank you all!

    
10.02.2017 / 19:17
0

Try this:

SELECT guia, convenio, nome, TRIM(REPLACE(matricula, '\t', ' '))
FROM tabela
WHERE guia = '142'
GROUP BY guia, convenio, nome, TRIM(REPLACE(matricula, '\t', ' '))
    
09.02.2017 / 21:34