AA테이블
==============
SELECT '1' AS IDX, '1' AS BNO, '1' AS KCNT, 'aaa.hwp' AS FILENAME FROM DUAL UNION ALL
SELECT '2' AS IDX, '2' AS BNO, '1' AS KCNT, 'bbb.hwp' AS FILENAME FROM DUAL UNION ALL
SELECT '3' AS IDX, '3' AS BNO, '2' AS KCNT, 'ccc.xls' AS FILENAME FROM DUAL UNION ALL
SELECT '4' AS IDX, '3' AS BNO, '2' AS KCNT, 'ddd.xls' AS FILENAME FROM DUAL UNION ALL
SELECT '5' AS IDX, '4' AS BNO, '2' AS KCNT, 'eee.doc' AS FILENAME FROM DUAL UNION ALL
SELECT '6' AS IDX, '4' AS BNO, '2' AS KCNT, 'egg.doc' AS FILENAME FROM DUAL
BB테이블
==============
SELECT '1' AS BNO, '동행1프로젝트' AS TITLE, '내용테스트1' AS CONTENTS FROM DUAL UNION ALL
SELECT '2' AS BNO, '동행2프로젝트' AS TITLE, '내용테스트2' AS CONTENTS FROM DUAL UNION ALL
SELECT '3' AS BNO, '동행3프로젝트' AS TITLE, '내용테스트3' AS CONTENTS FROM DUAL UNION ALL
SELECT '4' AS BNO, '동행4프로젝트' AS TITLE, '내용테스트4' AS CONTENTS FROM DUAL
출력결과
==============
BNO FILENAME1 FILENAME2 FILENAME3... TITLE CONTENTS
1 aaa.hwp 동행1프로젝트 내용테스트1
2 bbb.hwp 동행2프로젝트 내용테스트2
3 ccc.xls ddd.xls 동행3프로젝트 내용테스트4
4 eee.doc egg.doc 동행4프로젝트 내용테스트4
FileNAME1~ 파일갯수가 가변적이고
mysql4.버전으로 제한된 함수를 사용해야 하네요..
좀 도와주세요~~~ ㅠㅠ
|