当前位置:Gxlcms > 数据库问题 > ORACLE函数、连接查询、约束

ORACLE函数、连接查询、约束

时间:2021-07-01 10:21:17 帮助过:47人阅读


使用外连接可以查询不满足连接条件的数据

 技术分享

 

with字句

 技术分享

 

字符函数
lower upper initcap
concat substr length instr lpad/rpad trim replace
数字函数
round trunc mod
日期
months_between add_months next_day last_day round trunc
通用函数
nvl(excp,excp)
nvl2(exrp,excp,excp)
nullif(excp,excp)
coalesce(excp,excp···excp)
if-then-else

技术分享

技术分享

 

 

 

merge :如果满足条件的行存在,执行更新操作;否则执行插入操作:

技术分享

 


约束
约束是操作表数据的强制规定
有以下五种约束:
NOT NULL(只能定义在列级)
UNIQUE (可以定义在表级或列级)
PRIMARY KEY(可以定义在表级或列级)
FOREIGN KEY

技术分享

 

CHECK(定义每一行必须满足的条件)

添加约束语法
使用 ALTER TABLE 语句:
添加或删除约束, 但是不能修改约束(add/drop)
有效化或无效化约束(enable/disable)
添加 NOT NULL 约束要使用 MODIFY 语句

 

 

ORACLE函数、连接查询、约束

标签:select   lte   log   com   bsp   upper   字符函数   drop   表数据   

人气教程排行