I have three tables, which are as follows: ALUNO
, CLASSE
and MATRICULA
.
STUDENT
NR_RGM
NM_NOME
NM_PAI
NM_MAE
DT_NASCIMENTO
ID_SEXO
CLASS
CD_CLASSE
NR_ANOLETIVO
CD_ESCOLA
CD_GRAU
NR_SERIE
TURMA
CD_PERIODO
REGISTRATION
CD_CLASSE
NR_RGM
DT_MATRICULA
I'm doing INNER JOIN
with all three tables so I can return a query. Being this query:
select a.nm_nome
from aluno a
inner join matricula ma on (ma.nr_rgm = a.nr_rgm)
inner join classe c on (c.cd_classe = ma.cd_classe)
where a.nm_nome LIKE '%SILAS%' AND c.cd_classe = ma.cd_classe
The query works, but the problem is that it returns me repeated results. And it appears in Oracle by the following results:
How can I do it only returns me the required data without being repeated? I know there are some other similar questions already, but they did not help me what I needed.