oracle数据库零散知识01

1,rownum 是一个虚列,使用时必须包括1才能使用,rownum = 1,rownum < 10;  rownum = 2是不可以的;

2,if case loop 要加end结束,end if;

3,外键,foreign key(s) references table_name(pk)

4,创建一个表,复制内容 create table t_1 as select * from t_2;

5,存在一个表,复制内容 insert into t_1 select * from t_2;

6,清空一个表 truncate table t_1;

7,insert into .. values...

8,update t_1 set col = value where ...

9,delete from ...where ...

10,非空约束 alter里是 modify column not null,其他都是add 或者是 drop

11,sqlplus里格式化行大小 col column format a15;

12,round()与trunc()中正数控制小数部分,负数控制整数部分

13,substr(),其中正数从前截取,负数从后截取

14,to_char()转换成字符串 to_date()将字符串转换为日期

原文地址:https://www.cnblogs.com/whytohow/p/4911754.html