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

oracle基本操作

2015-08-07 09:56 447 查看
对表的结构操作
add 增
alter table 表名 drop (列 字符类型(长度)); 删
modify 改
desc dept; 查表结构

对记录操作
select 列名 from 表名 where 条件 查
update student set 列=“” where 条件 改
delete from 表名 where 条件 删(只删记录不删表结构)

max() 最大值
函数 min() 最小值
avg() 平均值
count() 总 值

关联数据库查询
select 列名,列名 from 表1,表2 where 主键=外键 and 条件
select 列名,列名 from 表1 where 表1主键=(select 表2外键 from
表2 where 条件)

like 字符% 以什么开头
order by 排序
group by 列名 having 条件 按什么分组统计在用having限制条件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oracle