select TBL_TOPIC.* from TBL_TOPIC
where boardId=1
and topicId not in (select topicId from TBL_TOPIC where boardId=1 and rownum<=1 order by publishTime)
and rownum <20 order by publishTime
提示缺失右括号
把子查询提取查询结果写入not in()中没有问题
select topicId from TBL_TOPIC where boardId=1 and rownum<=1 order by publishTime查询结果1,2select TBL_TOPIC.* from TBL_TOPIC
where boardId=1
and topicId not in (1,2)
and rownum <20 order by publishTime
正确请问怎么回事啊?
where boardId=1
and topicId not in (select topicId from TBL_TOPIC where boardId=1 and rownum<=1 order by publishTime)
and rownum <20 order by publishTime
提示缺失右括号
把子查询提取查询结果写入not in()中没有问题
select topicId from TBL_TOPIC where boardId=1 and rownum<=1 order by publishTime查询结果1,2select TBL_TOPIC.* from TBL_TOPIC
where boardId=1
and topicId not in (1,2)
and rownum <20 order by publishTime
正确请问怎么回事啊?
解决方案 »
- oracle 中truncate 和delete的区别
- 关于数据绑定类的第二个参数datetype,它怎么确定的呀
- oracle游标问题-求救大哥大姐们
- msdaora OraOLEDB
- 为什么我的for循环无法执行进去啊,游标不怎么会用,还请各位帮忙看看啊
- 奇怪了,我的这段程序为什么运行后不显示???我想测试下 execute immediate
- 系统 win2003+oracle9i ,在用Toad修改数据库数据后,过1天左右时间,数据自动恢复。请教各位是什么原因?如何才能够让数据修改后不再恢
- ASP脚本中,如何编写链接到ORACLE的语句
- group by 的问题?
- 我觉得很奇怪的问题:表被锁了?
- 求条SQL语句~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 一起探讨:距今超过10年的工龄的员工?
select topicId from TBL_TOPIC where boardId=1 and rownum<=1 order by publishTime
去掉order by publishTime就可以了
还有,如果rownum<=1,可以不使用not in了。
where boardId=1
and topicId not in (select topicId from TBL_TOPIC where boardId=1 and rownum<=1 order by publishTime)
and rownum <20 order by publishTime
--楼上所说不能在子查询中使用order by语句
--本人看了你的语句的意思写了下面的语句.
select * from (select TBL_TOPIC.* ,rownumn rn from TBL_TOPIC
where boardId=1 and rownum <20
order by publishTime) a
where rn between 2 and 19