Result with repeated records

0

Good afternoon! I'm making an appointment, but the result is bringing repeated occurrences. is there a command for the query to just bring a record of each column?

follow script:

SELECT *
FROM HIS_LOTPES A, his_afasta c, FERIAS D, PESSOAL P
WHERE A.HLOT_PESS_CD_MAT = c.hafa_pess_cd_mat(+)
AND A.HLOT_PESS_CD_MAT = D.FERI_PESS_CD_MAT(+)
AND P.PESS_CD_MAT = D.FERI_PESS_CD_MAT(+)
and a.hlot_dt_inicio <> c.hafa_dt_inicial(+)
and a.hlot_dt_saida <> c.hafa_dt_final(+)
and a.hlot_dt_inicio < feri_dt_inicio(+)
and a.hlot_uorg_cd_ent = '2'
and a.hlot_uorg_ufed_sg = 'DF'
and a.hlot_uorg_cd_org = '1'
and a.hlot_uorg_cd_gab = '101'
and a.hlot_uorg_cd_dep = '2'
and a.hlot_uorg_cd_div = '0'
and a.hlot_uorg_cd_set = '1'
and a.hlot_uorg_cd_sec = '1'
AND A.HLOT_DT_INICIO > '01/01/2015'

Thank you!

    
asked by anonymous 01.03.2016 / 20:55

1 answer

0

You can use the distinct option.

SELECT DISTINCT * FROM tabela

But it will be grouped if the whole row is equal, if a column is different it will bring (because if a column is different the record is not equal).

    
02.03.2016 / 15:06