-
카테고리
-
세부 분야
데이터베이스
-
해결 여부
미해결
subquery에서 table 이름 지정 문제
23.04.21 01:23 작성 23.04.21 01:23 수정 조회수 181
1
선생님 비상관 subquery에서 table 명을 지정해주어야 하는 이유가 꼭 있을까요?
선생님 코드는 from hr.emp_dept_hist_01 x 라고 지정해주셨었는데,
select * from hr.emp_dept_hist_01
where (empno, todate) in (select empno, max(todate) as todate from hr.emp_dept_hist_01 x group by empno) ;
비상관이면 없어도 되지 않을까하는 생각을 했습니다.
select * from hr.emp_dept_hist_01
where (empno, todate) in (select empno, max(todate) as todate from hr.emp_dept_hist_01 group by empno) ;
답변을 작성해보세요.
0
답변 1