Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excluir Registros Duplicados

Delete Duplicate Records

Good afternoon!

I need help.

I'm doing a query on the bench to bring the data in a table, but some data is coming duplicate.

TABELATESTE:

   

      SQL SELECT

Registration,

Month,

Business

      FROM DM "vw_FatoCensoFuncionario.";

The Filename field can only have a record of every month.

Example (right):

      month Registration

      Apr / 15 1245

      Apr / 15 2154

      May / 15 1245

      May / 15 2154

Example (WRONG):

      month Registration

      Apr / 15 1245

      Apr / 15 1245

      Apr / 15 2154

      May / 15 1245

      May / 15 2154

Apr / 15 2154

_______________________________________________________________________________________________________

Boa tarde!

Preciso de uma ajuda.

Estou fazendo uma consulta no banco para trazer os dados de uma tabela, porém alguns dados estão vindo duplicados.

TABELATESTE:

   

     SQL SELECT

          Matricula,

          Mes,

          Negocio

     FROM DM."vw_FatoCensoFuncionario" ;

O campo Matrícula só pode ter um registro de cada por mês.

Exemplo (certo):

     Mês          Matrícula

     abr/15       1245

     abr/15       2154

     mai/15       1245

     mai/15       2154

Exemplo (ERRADO):

     Mês          Matrícula

     abr/15       1245

     abr/15       1245

     abr/15       2154

     mai/15      1245

     mai/15      2154

     abr/15       2154


1 Reply
andrespa
Specialist
Specialist

Hi Welington,

Have you tried doing a "SELECT DISTINCT" on your SQL query? Like this:

SQL SELECT DISTINCT

          Matricula,

          Mes,

          Negocio

     FROM DM."vw_FatoCensoFuncionario" ;

Is the only thing I can think of. Otherwise I would say it could be a data source problem in your DB.

Hope it helps.

Cheers,

Andrés