Study/Oracle
[oracle] 여러가지 데이터 삽입 방법
힝쏘
2019. 5. 13. 10:42
* 새로운 insert문 형식으로 데이터 삽입.
* 숫자 ++..
select ( select max( ho_code ) from ho_info ) + rownum / 1
from ho_info;
* delete
delete from dong_info where apt_code=2;
- apt_info 데이터 삽입(과장님 작업)
insert into apt_info
select 2,
NAME || '2차',
ADDR,
DONG_COUNT
from apt_info;
- dong_info 데이터 삽입
insert into dong_info
select
2,
(select max(dong_code) from dong_info) + rownum / 1,
replace(name, '가나', '가나2차'),
ho_count
from dong_info;
- ho_info 데이터 삽입
insert into ho_info
select
2,
dong_code + 3,
(select max(ho_code) from ho_info) + rownum / 1,
replace(name, '가나', '가나2차'),
area,
price
from ho_info;