
oracle
qwnbc
湖南·绥宁
展开
-
sql 去空格与连接特殊字符
在分组排序过程中需要新建排序列,按条件:(物料分类+客户名称) 进行分组汇总 然后就根据该条件进行排序1.需要拼凑两列 作为排序列,如需加入特殊字符.就会报错. 因为本身改字段就是varchar类型 需要将char类型_ 转换成varchar2.拼凑过程中有空格需要去空格 e.g:select (trim(物料分类)+to_char(_)+客户名称) from tabl原创 2009-09-26 17:13:00 · 845 阅读 · 0 评论 -
Caused exception message is: ORA-12704: 字符集不匹配
该问题是在使用union all 合并select查询的两个结果集时,出现某个字段的类型与对应字段的类型不一致导致的. 因为sql比较长,一个一个字段在排除。终于发现字段bizDate: select to_char(FBizDate,yyyy-mm-dd hh24:mi:ss) as bizDate ---本身FbizDate是datetime类型转字符类型字段***原创 2009-09-27 20:56:00 · 3109 阅读 · 0 评论 -
oracle 字符连接
oracle 如果两字符相连不能用"+"select abc+bcd Error. additive operator can not use add Char Or NChar不能使用加号连接这两种字符select abc||bcd 就ok了原创 2009-09-28 11:20:00 · 1427 阅读 · 0 评论 -
sql error. target database is 'Oracle9' detail message is :
Caused exception message is: translate sql exception, message is format sql error. target database is Oracle9 detail message is :unexpect function, function name is companysource sql is : 表示 s原创 2009-10-16 15:45:00 · 4670 阅读 · 1 评论 -
inner join 数据重复问题
在查询数据时. 写了一段sql 很奇怪.查询前5个表的数据时,不会出现重复数据 直到关联第六个表时(T_IM_InventoryBalance ),重复数据很多。一时间很郁闷.随后咨询实施人员才知。 原来T_IM_InventoryBalance 本身就有多条重复数据,也就是说当material.fid = ib.fmaterialId 关联时 是一对多的关系..需要设置多个条件才能原创 2009-11-10 01:23:00 · 13835 阅读 · 0 评论 -
Caused exception message is: ORA-01789: query block has incorrect number of result columns
Caused exception message is: ORA-01789: query block has incorrect number of result columns 表示在使用union all 合并表时列的数量不一致、肯定是哪里漏了一个字段。原创 2009-11-12 20:44:00 · 2128 阅读 · 0 评论