Search function for Sql Server

0

I would like to know if it has a function or if it could be done with a select , the search by the email field of a table. Example:

select PPESSOA.EMAIL from PPESSOA where PPESSOA.NOME like 
'ABNER FONTOURA C,RÊA'
'ADAILTON PEREIRA DE SOUZA' 
'ADALBERTO ROMUALDO PEREIRA HENRIQUE',
'ADELINA MARIA GOMES SCHETTINI ' ,
'ADELINA MARIA VASCONCELOS DE OLIVEIRA ' ,
'ADELLE KARINNE NASCIMENTO SILVA' ,
'ADEMIR VIEIRA DE MELO GARCIA' ,
'ADENILSON OLIVEIRA ANDRADE' ,
'ADENILSON ROBERTO JOSE PEREIRA' ,
'ADILLO LUIZ FARIA MEZZOMO' ,
'ADILSON DA SILVA ALVES ',
'ADILSON MARCOS MENDES ' ,
'ADMILSO ANTONIO DA SILVA ' ,
'ADMILSON SILVA FINTELMAN ' ,
'ADRIANA ALMEIDA DE SOUZA ' ,
'ADRIANA APARECIDA ALVES DE FREITAS ' ,
'ADRIANA APARECIDA CAETANO DA SILVA ' ,

and has over 3000 records ..

How do I do it?

    
asked by anonymous 26.11.2014 / 18:06

1 answer

1

Use LTRIM and RTRIM on each occurrence to avoid spaces as follows:

select PPESSOA.EMAIL from PPESSOA where PPESSOA.NOME in ( 
ltrim(rtrim('ABNER FONTOURA C,RÊA')),
ltrim(rtrim('ADAILTON PEREIRA DE SOUZA')),
ltrim(rtrim('ADALBERTO ROMUALDO PEREIRA HENRIQUE')),
...
);
    
26.11.2014 / 19:01