2012-01-20 2 views
0
select * from (select no,item,desc,user from table where no=1) x , 
select no,item,desc,max(item_date),user from table where no=1 group by no,item,desc) y where x.no=y.no 

은 실행 후, 그것은 준다 오류 :는 오라클 11g의 그들 중 하나의 기능을 두 쿼리에 참여

select x.*, y.* from 
(select no,item,desc,user from table where no=1) x , 
(select no,item,desc,max(item_date),user from table where no=1 group by no,item,desc) y 
where x.no=y.no 

또는 : : 다음을 시도 할 수 있습니다

ORA-00904: "Y"."NO" invalid identifier 

답변

0

select x.*, y.* from 

(select no,item,desc,user from table where no=1) x 

left join 

(select no,item,desc,max(item_date),user from table where no=1 group by no,item,desc) y 

on x.no=y.no 

원하는 방식에 따라 왼쪽/오른쪽/내측 조인 사용 물론 합류하게 될 것입니다.

관련 문제