Warning: Undefined array key "mobile_dir" in /home/kagla/new-sir/old/common.php on line 315
DB table A의 자료를 table B로 복사하는 방법 문의

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

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

QA

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

답변 1

본문

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

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 필요한 조건

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,406
© SIRSOFT
현재 페이지 제일 처음으로