조언부탁드립니다.
with AA AS
(SELECT '1000' AS code1, '1100001' AS code2, '1' AS seq, 'aa@a.com' as eamil FROM dual
UNION ALL SELECT '1000' AS code1, '1100001' AS code2, '2' AS seq, 'bb@a.com' as eamil FROM dual
UNION ALL SELECT '1000' AS code1, '1100001' AS code2, '3' AS seq, 'cc@a.com' as eamil FROM dual
) select * from AA
with BB AS
(SELECT '1000*1100001*1!1000*1100001*3!' AS key1 FROM dual
) select * from BB
위와 같이 2개 테이블이 있고
이때 BB테이블에 있는 key1값은 동일한 패턴으로 가변적으로 늘어날수 있습니다.
두 테이블을 조인해서
1 | aa@a.com
3 | cc@a.com
이란 결과를 얻고 싶은데....
쿼리로 가능할까요?
|