--decode
decode(column,if_value,value,elseif_value,value,default_value); decode(条件,值1,翻译值1,值2,翻译值2,...值n,翻译值n,缺省值) 好比一张表: select decode(score,'A','优秀','B','良好','C','及格','不及格') from t_table
--sum
求和函数
--wm_concat
该函数可以把列值以","号分隔起来,并显示成一行
2.常用sql语句 ↑
--新建用户
create user zhaopei identified by zhaopei;
--给用户权限
grant dba to zhaopei ;
--删除表字段
alter table Tbl_Survey_Human_New DROP COLUMN 字段名; alter table Tbl_Survey_Human_New DROP COLUMN n_oa_report_FLAG;
--新增表字段
alter table Tbl_Survey_Human_New add(字段名 字段类型); alter table Tbl_Survey_Human_New add(n_protocaryon_report_FLAG varchar2(2));
--修改表字段
alter table Tbl_Survey_Human_New modify(字段名 字段类型); alter table Tbl_Survey_Human_New modify(c_caseisreal_type varchar2(30));
--添加字段备注
comment on column 表名.字段名 is '注释'; comment on column Tbl_Report_Caseseat.BLOCKED is '派查勘员受阻';
--创建序列
create sequence mysq minvalue 1 --最小值 maxvalue 99999999999999999 --最大值 start with 1 --开始值 increment by 1 --每次增长值 cache 20; --缓存大小