-2

My sql code:

    SELECT COUNT(*)
FROM T_DATA_ALUNO_TURNO at, T_DATA_TURNO dt
WHERE at.ALUNOID = (SELECT DISTINCT ALUNOID
                    FROM T_DATA_ALUNO_REGLECTIVO) AND
      at.TURNOID=dt.ID;

I'm getting this error:

ORA-01427: single-row subquery returns more than one row"

Any way to do this query?

AaronY_Pt
  • 3
  • 1
  • 1
    Is there anything confusing about the error message? What are you trying to do? It's not clear? – Ben Jun 16 '14 at 20:25

1 Answers1

1

try IN instead of = for at.ALUNOID

aebmad
  • 1,390
  • 1
  • 15
  • 14
  • You don't actually know that this is the correct answer unfortunately... the OP hasn't stated what they're actually trying to do... it might be that they actually wanted equals. – Ben Jun 16 '14 at 20:26