日期:2014-05-16  浏览次数:20430 次

ORA-00932: 数据类型不一致: 应为 -, 但却获得 CLOB
紧接第上篇文章。
第一步:查看SQL语句。
修改语句成:
select  a.id,
                b.name as statusName,
                a.currentHandle,
                a.progressAndPlan,
                a.customerService,
                c.fullname as customerServiceName,
                c.fullname as currentHandleName
  from defect1 a
  left join user_info c on a.customerService = c.user_id
  and a.currentHandle = c.user_id,
  left join site1_attr e on a.siteID = e.site_id, dir_status b
where 1 = 1
   and a.status = b.id
   and a.createTime >=
       to_date('2012-03-01 00:00:00', 'yyyy-mm-dd HH24:mi:ss')
   and a.createTime <=
       to_date('2012-03-31 23:59:59', 'yyyy-mm-dd HH24:mi:ss')
   and a.B_versionName = 'OCS R002C01LG0309 '
order by createTime desc

第二步:连接语句中的每一张表是否有重复对应id。
select count(*) from defect1,(user_info,site1_attr ).
发现site1_attr 中有重复id.

第三步:查看SQL语句发现:
site1_attr e 这张表,前后语句都没有用。

第四步:删掉:
left join site1_attr e on a.siteID = e.site_id,

第五步:执行成功。