From: Mario Jorge Nunes Filipe <mjnf@neptuno.sc.uevora.pt>
To: pgsql-sql@postgresql.org
Subject: A dillema ...
Date: Wed, 03 Mar 1999 17:21:03 +0000
Message-ID: <36DD6F7F.D70E0265@neptuno.sc.uevora.pt> (raw)
Hi
i have a table with the following schema :
Table = epoca
+---------------------------+----------------------------------+-------+
| Field | Type | Length|
+---------------------------+----------------------------------+-------+
| codigo | int4 | 4 |
| descricao | varchar() | 20 |
+---------------------------+----------------------------------+-------+
and another with
Table = aluno_inscricao
+---------------------------+----------------------------------+-------+
| Field | Type | Length|
+---------------------------+----------------------------------+-------+
| numero_aluno | int4 | 4 |
| codigo_disciplina | int4 | 4 |
| ano_lectivo | char() | 10 |
| epoca | int4 | 4 |
| semestre | bool | 1 |
+---------------------------+----------------------------------+-------+
The field epoca is an "index" to the table epoca.
The table epoca has :
sac=> select * from epoca;
codigo|descricao
------+-------------------
1|Normal
2|Especial
3|Recurso
6|Recurso Antecipado
4|Melhoria E. Normal
5|Melhoria E. Recurso
when selecting from instancia_disciplina for a particular
codigo_disciplina i get :
sac=> select distinct epoca from aluno_inscricao where
codigo_disciplina=671;
epoca
-----
1
3
4
5
6
Now if i want to get codigo and descricao from epoca according to the
results above i would do:
sac=> select distinct e.codigo, e.descricao from epoca e,
instancia_disciplina i where i.epoca=e.codigo and
i.codigo_disciplina=671;
codigo|descricao
------+-------------------
1|Normal
3|Recurso
5|Melhoria E. Recurso
6|Recurso Antecipado
Why doesn't codigo=4 show up, since before the join it did.
I tryed this both on 6.4 and 6.3.2 same results
THanks
--
Mario Filipe
mjnf@uevora.pt
http://neptuno.sc.uevora.pt/~mjnf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: mjnf@neptuno.sc.uevora.pt
Subject: Re: A dillema ...
In-Reply-To: <36DD6F7F.D70E0265@neptuno.sc.uevora.pt>
References: <36DD6F7F.D70E0265@neptuno.sc.uevora.pt>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox