2013-06-17 2 views

답변

1

외부 선택을 완료하기 위해 마지막에 from dual이 누락되었습니다.

당신이 플러스 from dual했다 정확하게 : 오라클 데이터베이스에 대한

select 
((select count(*) from Person,Professor where ID_Person = ID_Professor) + 
(select count(*) from Person, Student where ID_Person = ID_Student)) 
from dual 
+0

감사하지만 솔직히 당신은 무엇을 의미합니까되지 않습니다 - 귀하의 질문에 대한

당신은뿐만 아니라 쿼리를 다음 시도 할 수 있습니다? – Engine

+0

방금 ​​SQL을 배우기 시작했습니다 – Engine

+0

덕분에 작동합니다. – Engine

1

wumpus 사 Q. Wumbley 주신 올바른 제안을. 답변에 대한

select sum(c_total) 
    from (
     select (select count(*) from professor 
       where professor.id_professor=person.id_person) 
      + (select count(*) from student 
       where student.id_student=person.id_person) c_total 
     from person 
    group by person.id_person) 
관련 문제