SELECT a.last_name, a.salary, a.department_id, b.salavg
FROM employees a, (SELECT department_id, AVG(salary) salavg FROM employees GROUP BY department_id) b
WHERE a.department_id = b.department_id
AND a.salary > b.salavg;
insert into C_DWLCC_history select * from C_DWLCC where yf='201501'
select * from TEST t order by 1 (按第一列来排序)
insert into J_PBXX_history select * from J_PBXX where yf='201501' //还是解释解释吧
要往里面添记录,要求目标表必须存在
SELECT INTO FROM语句
语句形式为:SELECT vale1, value2 into Table2 from Table1
要求目标表Table2不存在,因为在插入时会自动创建表Table2,并将Table1中指定字段数据复制到Table2中
要求目标表不存在. 平时很少用 用在记录或存档 (可以指定列,可以有where .join等 很好的备份或存档方法)
这个oracle不支持 (在oracle中是别的意思)
oracle里类似功能的是
create table tableB as
select qf.qfje from s_qf qf
LCASE() low 转小写
UCSSE() up大写
oracle 不支持上面俩.用的upper() 和 lower()
开头说视图了
视图分为简单视图和复杂视图。
该吃饭了.调优上班时候看,等下写oracle的表空间