您的位置:首页 > 数据库 > Oracle

oracle数据库零散知识01

2015-10-26 17:07 369 查看
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()将字符串转换为日期
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: