Como faço para filtrar dados com sql mas sem repetir reg, ?

Delphi

29/05/2006

Tenho esta sql.

 a:=´SELECT * from ARQ_HIST a1 WHERE PAGA is null and venc between current_date -140 and current_date -5 and not exists´;
         b:=´(select * from arq_hist a2 where paga is null and a2.inscricao = a1.inscricao and venc < current_date -140) and exists´;
         c:=´(select * from arq_nome a3 where a1.inscricao = a3.inscricao and fale is not null) and exists´;
         d:=´(select * from arq_prin a4 where a1.inscricao = a4.inscricao and telefone is not null)´;


Mas no valor que ela me retorna, traz registros repetidos, como eu encaixo aquele comando para nao repetir nesta sql ?


Geisonc

Geisonc

Curtidas 0

Respostas

Marcio.theis

Marcio.theis

29/05/2006

vc pode usart a instrução DISTINCT mas para isto irá precisar informar os campos desejados no SELECT.


GOSTEI 0
POSTAR