随笔分类 - orcle
摘要:1:本月第一天 select trunc(add_months(last_day(sysdate), -1) + 1) from dual select trunc(sysdate,'mm') from dual; 2:本月最后一天 select trunc(last_day(sysdate)) f
阅读全文
摘要:一:case when 的两种用法 1: case 字段名 when 字段值 then 希望值 when 字段值 then 希望值 else 希望值 end 2: case when 条件 then 希望值 when 条件 then 希望值 else 希望值 end 注:case 函数 只能返回一个
阅读全文
摘要:1:查询数据库连接 2杀掉进程 3 查询连接是否别killed 删除所有的连接即可删除用户 4删除用户 drop user biz_xnjd_zc cascade;
阅读全文
摘要:一:dblink 1查看dblink 2创建dblink 再查看时就会发现有两个dblink 3删除dblink
阅读全文
摘要:添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….); 修改字段的语法:alter table tablename modify (column datatype [default
阅读全文
摘要:查询及删除重复记录的SQL语句 1、查找表中多余的重复记录,重复记录是根据单个字段(Id)来判断 select * from 表 where Id in (select Id from 表 group byId having count(Id) > 1) 2、删除表中多余的重复记录,重复记录是根据单
阅读全文
摘要:1:用sequence序列生成流水号 create sequence L_SIGN_IN minvalue 1 maxvalue 9999999999999999999999999999 start with 1 increment by 1 cache 20; 这里是生成了序列l_sign_in,
阅读全文

浙公网安备 33010602011771号