HomeForum
Welcome, Guest

Error in multinivel SQL Query
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Error in multinivel SQL Query

Error in multinivel SQL Query 2 years ago #847

  • acury
  • OFFLINE
  • Junior Boarder
  • Posts: 20
  • Karma: 0
Hi,

I´m try execute a report (or query) in the ETL, but the return value not correct:

SELECT * FROM (
SELECT NOME_COMPLETO,NOME_TURMA,NRO_CHAMADA,Count(*) QTD FROM (
SELECT a.nome_completo,t.nome_turma,at.nro_chamada,
TO_CHAR(ocorrencia_comunicado.data, 'DD/MM/YYYY'), disciplinas.nome1_15,
professores.apelido, ocorrencia_tipo.descricao, ocorrencias.descricao,
ocorrencia_comunicado.descricao, ocorrencia_comunicado.cod_ocorrencia_comunicado
FROM
turmas t,aluno_turma AT, alunos a,ocorrencia_aluno oa,ocorrencia_comunicado, ocorrencia_tipo, ocorrencias, professores, disciplinas
WHERE
ocorrencia_comunicado.cod_ocorrencia_comunicado = oa.cod_ocorrencia_comunicado
AND a.cod_aluno = oa.cod_aluno
AND at.cod_aluno=a.cod_aluno
AND t.cod_turma=at.cod_turma
AND t.ano = 2010
AND AT.ano = 2010
AND ocorrencias.cod_ocorrencia = ocorrencia_comunicado.cod_ocorrencia
AND ocorrencia_tipo.cod_ocorrencia_tipo = ocorrencias.cod_ocorrencia_tipo
AND professores.cod_prof = ocorrencia_comunicado.cod_prof
AND disciplinas.cod_disc = ocorrencia_comunicado.cod_disc
AND ocorrencia_comunicado.data >='01/01/2010'
) GROUP BY NOME_COMPLETO,NOME_TURMA,NRO_CHAMADA
) WHERE QTD >=5 ORDER BY QTD DESC


The field QTD return a incorrect value, if run the query in the sqldeveloper, the result is correct, my database is Oracle 10g.

I´m try create one view, but the problem persist.

tanks

Tanks

Re:Error in multinivel SQL Query 2 years ago #849

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2183
  • Karma: 12
I have never seen anything like this before
May be you are connected to two different databases?
Of different users?

Peter

Re:Error in multinivel SQL Query 2 years ago #850

  • acury
  • OFFLINE
  • Junior Boarder
  • Posts: 20
  • Karma: 0
I also do not ...

No, all tables are in the same Oracle user, the only thing \"different\" in research is a SELECT inside another SELECT, doing research within the sqldeveloper totals are right, doing it within the ETL returns results with higher values ( for example, in sqldeveloper it returns 32 for a record, it returns the ETL 82!)

Can you do a test there with this kind of query?

Thanks

Re:Error in multinivel SQL Query 2 years ago #851

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2183
  • Karma: 12
Is there any way we can connect remotely and nave a look

Peter
  • Page:
  • 1
Time to create page: 0.17 seconds

Testimonials

We Process 3000 files daily, 24h x 365d

C Gandhi
Nesa-Canada

User Login

You only need to log in or register to use our support forum



Our customers

BP

BBC

HSBC


Databases we work with

Go to top