[1] 테이블 복사 방법
create table owners_copy Like owners;
insert into owners_copy select * from owners ;
[2] 테이블 복사 방법 2
create table owners_copy2 select * from owners ; // 행 값이 복사가 된다
[3] 임시테이블
create temporary table if not exists (동일 테이블이 없을 때만) temp_tabel (
tempId int primary key auro_increment ,
tempName varchar(10)
);
[4] 처음 만들었을 때의 상태로 초기화
Truncate table table_name;
'MySQL' 카테고리의 다른 글
TRANSCATION / ROLLBACK (0) | 2022.02.03 |
---|---|
Inner join / Left join / Right join (0) | 2022.02.03 |
서브쿼리 정리하기 (0) | 2022.01.27 |
sum , count , average (0) | 2022.01.27 |
concat / ltrim ,rtrim / upper, lower , reverse / replace, substring, length / abs, round, ceil, floor / pow , rand (0) | 2022.01.27 |