请问要在oracle数据库里查满足条件的前10条记录,sql该怎么写?

tager tager 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我的SQL是这以写的:
String sql = "select top 10 distinct username, sum(http) from PROXY_DAILY4USER_REPORT where year=" + year + "and month=" + month + " group by username order by sum(http) desc";

报错:

The source of this error is javax.servlet.ServletException: ORA-00923: 未找到预期 FROM 关键字

把 top 10 去掉就没错误,请问这个sql该怎写?
...全文

相关推荐

评论 14
收藏 已收藏
分享
返回顶部
tager
Web 开发 81,108 成员 341,721 内容