免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1217 | 回复: 2
打印 上一主题 下一主题

一个读取LONG类型的sql错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-05-12 16:52 |只看该作者 |倒序浏览
SELECT *  
FROM(
                        select /*+ INDEX(VENUES VENUES_CITY) */ District,Address1,Name,Phone,VenueID,feature,elong_lohoo_card,DIRECTIONS,parentvenueid,venuetype,2 from Venues where (  branchvenue=0 and status=3 and (elong_card is not null or elong_lohoo_card is not null) and ((sysdate-end_date)<2)) order by VenueID desc
)
WHERE rownum<=7
minus
SELECT *
FROM(
select /*+ INDEX(VENUES VENUES_CITY) */ District,Address1,Name,Phone,VenueID,feature,elong_lohoo_card,DIRECTIONS,parentvenueid,venuetype,2 from Venues where ( branchvenue=0 and status=3 and (elong_card is not null or elong_lohoo_card is not null) and ((sysdate-end_date)<2)) order by VenueID desc
)
WHERE rownum<=8
ORDER BY 5 DESC

报错误的使用long类型,请问我该怎么改写。note是long

论坛徽章:
0
2 [报告]
发表于 2004-05-12 21:03 |只看该作者

一个读取LONG类型的sql错误

题目不是很看得懂。
long类型使用很受限制。不能在where,group by,order by 等里使用
minus 得实质是把每列来作比较,note 也作了比较。oracle认为这是在
where条件。
error-ora-997 错误
我用union all 就成功了。

论坛徽章:
0
3 [报告]
发表于 2004-05-12 21:18 |只看该作者

一个读取LONG类型的sql错误

解决方法:

create table t(id intege,name varchar2(50),note long)
select * from where (id,name) in
(select id,name from t where rownum < 8
minus
select id,name from t where rownum <
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP