Monday, August 16, 2010

Oracle 11g: Insert Statement

===>  SQL Queries:  Use & to Prompt Value

insert into departments
(
  department_id,
  department_name,
  location_id
)

values
(&department_id,'&department_name',&locationid)

===>  SQL Queries:  Copying rows from another table

insert into sales_reps(id_name,salary,commission_pct)
select employee_id,last_name,salary,commission_pct
from employees
where job_id like '%REP%'

No comments: