oracle 中更改用户: alter user soctt account unlock;
常见函数 :
select lower(column) from table; 把该列转化为小写
select upper(column) from table; 把该列转化为大写
select substr(column,1,3) from table; 截取该列中从第一个字符开始,长度为3的字符串
select round(23.652,2) from table; 四舍五入
select to_char(column,'$99,999,99') from table; 转化为指定格式
select to_char(column,'YYYY-MM-DD HH:mm:ss) from table; 转化为时间格式
select count(*) from table; 获取数据总行数
select count(column) from table; 获取非空的数据行数
关于查询分组的基本语法:
select col1 avg(col2) from table group by col1;出现在select 列表的字段没有出现在主函数中,必须出现在group by 中
如果有条件限制 用 'having'
select col1 avg(col2) from table group by col1 having avg(col2) > 200;
where 和 having 的区别:
where 用于单行过滤,而having 用于分组过滤
DDL 和DML语句
DDL 数据定义语言
如:
create table
drop table
alter table 等语句
DML 数据操作语言
insert into
update
delete 等语句