您的位置:首页 > 数据库 > Oracle

oracle clob类型字段查询方法

2013-11-21 13:38 609 查看
今天要查询clob类型字段为空的记录。颇费一番周折才找到一个方法,记录以供参考。
select s.testcaseid from b_t_testcasestepinfo s where pjid = '2013WARD120006'
and actorphase = 1
and not (s.stepid = 1 and s.stepaction6 not like '%') and s.stepresult6 not like '%';
注:
1、stepaction6为clob类型。
2、该脚本在PLSQL developer工具上执行报错,在Oracle SQL Developer上可以执行。
3、直接s.stepresult6 like ''不能查询到想要的结果

看到一些关于此类查询的文章, 推荐建立oracle全文索引,再使用contains函数,效率是更高的。
参考文章如下:
http://www.iteye.com/problems/64807
http://blog.csdn.net/pathuang68/article/details/4093665
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: