Skip site navigation (1) Skip section navigation (2)

Trying to avoid double results

From: Tan ga <gndtanga(at)mail(dot)pt>
To: pgsql-novice(at)postgresql(dot)org
Subject: Trying to avoid double results
Date: 2002-10-22 13:35:47
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
I'm trying to select the occurrence with the higher indice(it's a field) value
and i don't want to show double occurrences like:

ALGA TP 1 0(indice) 14:00
ALGA TP 1 1(indice) 15:00 <-- i just want to show this one because this line
substitutes the previous one

The problem is that when i add the field inicio, that says when a determined
class starts, i have this double results because it starts at a different hour.

Here's my select (i don't know if it's going to help or just make it
complicated :) )

evento.duracao from evento LEFT JOIN "salaEvento" ON
(evento.disciplina="salaEvento".disciplina AND evento.tipo="salaEvento".tipo
AND evento.parte="salaEvento".parte AND 
where evento.disciplina='ALGA' AND (evento.tipo='T' OR evento.tipo='P' or
group by evento.disciplina,evento.parte,      
vento".sala,	   evento."idPeriodo" order by evento.turno,evento.tipo;
Crie o seu email gratuito no

pgsql-novice by date

Next:From: Evert CartonDate: 2002-10-22 16:31:02
Subject: Calling functions indirectly using their name
Previous:From: Sergey MamvriyskyDate: 2002-10-22 13:05:00
Subject: Help with "struct Port"

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group