게시일: Oct 12, 2011 1:45:23 AM
select pid -- using 사용시는 alias 사용불가
, a.pname
, b.phone
from (
select '1' pid, '홍길동' pname from dual
union all
select '2' pid, '장길산' pname from dual
union all
select '3' pid, '임꺽정' pname from dual
) a -- 인간 마스터
inner join
(
select '1' pid, '아이폰' phone from dual
union all
select '2' pid, 'HTC Desire' phone from dual
union all
select '3' pid, '갤럭시S' phone from dual
union all
select '3' pid, 'AnyCall' phone from dual
union all
select '4' pid, '코드오류' phone from dual
) b -- 인간별 소유 폰
-- on b.pid = a.pid
using (pid) -- using 사용시는 alias 사용불가
아래의 링크를 확인하시면 살아있는 코드를 확인할 수 있습니다.
GoGo~~~