select prod_id,prod_type_name,
min(prod_id) KEEP( dense_rank first ORDER BY res)
--max(prod_id) KEEP(dense_rank LAST ORDER BY res)
from prod
where res like '%服务区%';错误提示:ora-00923: from keyword not found where expected我看语法应该是:
FIRST/LAST Syntax
These functions have the following syntax:aggregate_function KEEP
( DENSE_RANK LAST ORDER BY
expr [ DESC | ASC ] [NULLS { FIRST | LAST }]
[, expr [ DESC | ASC ] [NULLS { FIRST | LAST }]]...
)
[OVER query_partitioning_clause]似乎没有问题,为什么会出错呢,麻烦各位帮我分析下,谢谢!
min(prod_id) KEEP( dense_rank first ORDER BY res)
--max(prod_id) KEEP(dense_rank LAST ORDER BY res)
from prod
where res like '%服务区%';错误提示:ora-00923: from keyword not found where expected我看语法应该是:
FIRST/LAST Syntax
These functions have the following syntax:aggregate_function KEEP
( DENSE_RANK LAST ORDER BY
expr [ DESC | ASC ] [NULLS { FIRST | LAST }]
[, expr [ DESC | ASC ] [NULLS { FIRST | LAST }]]...
)
[OVER query_partitioning_clause]似乎没有问题,为什么会出错呢,麻烦各位帮我分析下,谢谢!
解决方案 »
- 如何用sql语句写入含blob类型字段的数据?
- Oracle问题疑惑不解,高手请进!真诚询问……
- 数据库名问题
- 存储过程
- ???菜鸟刚学oracle,以前用sqlserver的时候给一个字段设成datetime类型,再给他的默认值写成getdate(),就可以自动记录这条记录入库的
- 分布式应急系统
- 登陆SQL*plus出错!
- 开新贴感谢给我原代码的朋友dihai2000
- 动态sql4
- 启动数据库时报错 Error 57 initializing SQL*Plus Error loading message shared library
- jsp访问oracle数据库很慢,请知道原因的朋友帮忙
- 怎样查重复的数据?
select prod_id,prod_type_name,
min(prod_id) KEEP( dense_rank first ORDER BY res) over () (order by res)
--max(prod_id) KEEP(dense_rank LAST ORDER BY res) over () (order by res)from prod
where res like '%服务区%';
SQL> select id,mc,sl,
2 min(mc) keep (DENSE_RANK first ORDER BY sl) over(partition by id),
3 max(mc) keep (DENSE_RANK last ORDER BY sl) over(partition by id)
4 from tyj_test;
min(mc) keep (DENSE_RANK first ORDER BY sl) over(partition by id),
*
ERROR at line 2:
ORA-00923: FROM keyword not found where expected我用网友推荐的试了下,也是报一下的错,难道是版本问题吗 我的是oracle 9i的