1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | SET @rank=10; insert into xboard_board_qna (BOARD_NO, PARENT, CHILD, DEPTH, WRITER, PASSWD, REMOTE_ADDR, CATEGORY, TITLE, CONTENTS, MD5_CHECKSUM, MEMBER_LICENSE, REPLY_MAIL, USE_HTML, USE_SECRET, USE_TRACKBACK, NOTICE, VideoFile, ImageFile, FileSize, PlayTime, HIT, COMMENT, HOMEPAGE, EMAIL, LINK1, LINK2, FIELD_STATUS, OPEN_DOC, RTIME, RANK, FLAG1, FLAG2, FLAG3, FLAG4, ETC1, ETC2) SELECT (@rank:=@rank+1) as BOARD_NO, CONCAT('-',@rank) AS PARENT , '0' AS CHILD , '0' AS DEPTH, WRITER, PASSWD, REMOTE_ADDR, '1' AS CATEGORY , TITLE, CONTENTS , '' as MD5_CHECKSUM, CASE WHEN reg_id='admin' then '1' else '' end as MEMBER_LICENSE, '' as REPLY_MAIL, 1 as USE_HTML, USE_SECRET, 0 as USE_TRACKBACK, NOTICE, '', '', '', '', HIT, (SELECT count(*) FROM bitins.hms_board__cmt a WHERE a.parentIDX=BOARD_ID) as COMMENT, null as HOMEPAGE, EMAIL, '' AS LINK1, '' AS LINK2, '', 0, RTIME, RANK, 'Y' AS FLAG1, 'N' AS FLAG2, 'Y' AS FLAG3, 'N' AS FLAG4, ETC1, ETC2 FROM xboard_board_ipsi WHERE BdCode='qna' order by BOARD_ID ASC |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | SET @rank=6; insert into xboard_comment (COMMENT_NO, BOARD_ID, PARENT, MEMO, RTIME, PASSWD, MEMBER_LICENSE, WRITER, REMOTE_ADDR) select (@rank:=@rank+1) as COMMENT_NO, BdCode as BOARD_ID, parentIDX as PARENT, content AS MEMO, reg_date AS RTIME, reg_pwd AS PASSWD, '1' AS MEMBER_LICENSE, '관리자' AS WRITER, reg_ip AS REMOTE_ADDR from bitins.hms_board__cmt ; delete from xboard_comment |
'Programming > DataBase' 카테고리의 다른 글
[oracle] IN 과 NOT IN (0) | 2015.11.27 |
---|---|
ORA-00054: 리소스가 사용 중이어서 NOWAIT가 지정되었거나 시간 초과가 만료된 상태로 획득합니다. 오류 처리 (0) | 2015.11.09 |
[Mysql] oracle의 START WITH CONNECT BY 구문을 mysql로 구현하기 (0) | 2015.07.07 |
[oracle] 데이터 개별 일괄 업데이트 (0) | 2015.06.17 |
[oracle] 테이블 전체 삭제 (0) | 2015.05.29 |