(mywes)


他们彼此深信,是瞬间迸发的热情让他们相遇。这样的确定是美丽的,但变幻无常更为美丽

留言簿

公告

最新日志

最新评论

搜索

登陆

友情连接

统计

2006/7/28 8:58:00
clob字段使用union问题。

做论坛类网站时,会遇到主题表和回复表的内容字段都为clob字段,此时要取出一个贴子时,会使用到union,它这时会报ORA-00932 不一致的数据类型 要求 -得到的却是clob错误。

原因是:lob字段不能做group by,而union中需要使用group by过滤到重复纪录,所以不行

解决方法:用union all就可以了

 

select title,
       content,
       writerid,
       writer,
       speechtime,
       points,
       faceid,
       point,
       gold,
       idiographp,
       idiographt
  from ((
  select
 
  title, content, writerid, writer, speechtime, points
           from vo_bbstopictab
          where topicid = '1153996430976t2cj0'
         
         
          ) union all
        (select title, content, writerid, writer, speechtime, points
           from vo_bbsreplytab
          where topicid = '1153996430976t2cj0')),
       vo_usertab
 where writerid = userid
 order by speechtime

发表评论:

    昵称:
    密码:
    主页:
    标题: