채택완료

DB table A의 자료를 table B로 복사하는 방법 문의

DB table A의 자료를 table B로 복사하는 쿼리문 하나만 작성해 주시면 정말 감사드릴게요.
php는 복붙만 하는 수준이라 염치없이 부탁 드립니다.

 

테이블 A와 B의 구성은 아래와 같구요.

-----------------------

table A
칼럼명 bo_table, wr_id, mb_id, no_datetime

 

table B
칼럼명 bo_table, wr_id, mb_id, bg_flag, bg_datetime

 

아래와 같이 실행하는 쿼리문을 만들고 싶습니다.

-----------------------

table A bo_table -> table B bo_table 로 복사
table A wr_id -> table B wr_id 로 복사
table A mb_id, -> table B mb_id 로 복사
table A no_datetime -> table B bg_datetime 로 복사
table B bg_flag -> 'clear' 문자 일괄 입력

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트

insert into table_b ( bo_table, wr_id, mb_id, bg_datetime, bg_flag) select bo_table, wr_id, mb_id, no_datetime, 'clear' from table_A where 필요한 조건

답변에 대한 댓글 1개

엑스엠엘님 매번 도움만 받네요. 무한 감사드립니다.^^

답변을 작성하려면 로그인이 필요합니다.