table_from 이라는 이름의 테이블에서 table_to 라는 이름의 테이블로 데이터를 복사 및 변경 쿼리 (업데이트 쿼리)

 

====================================================================

예시 상황 : talbe_from 이라는 이름의 테이블에 있는 name 컬럼의 값을 table_to 라는 이름의 테이블에 있는 sub_name 로 update

WHERE

각 테이블의 date와 code가 일치하는 행에 대해서 이와 같은 작업 진행

====================================================================

UPDATE table_from, table_to SET table_from.name = table_to.sub_name WHERE table_from.date = table_to.date AND table_from.code = table_to.code ;

====================================================================

 

+ Recent posts