求大神将mysql语句转换成oracle语句

swt506 2014-11-15 10:33:36
mysql语句
SELECT id,company_id,position,is_display,urgent,geo_code,company_name from l_c_j_view where is_display=1 GROUP BY company_id order by update_time DESC, create_time DESC limit 1,24
...全文
224 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
swt506 2014-11-15
  • 打赏
  • 举报
回复
感谢版主大神
CT_LXL 2014-11-15
  • 打赏
  • 举报
回复
引用 3 楼 swt506 的回复:

select * from(
SELECT  id,
        company_id,
        position,
        is_display,
        urgent,
        geo_code,
        company_name,
        row_number()over(partition by company_id order by id desc) rn
from l_c_j_view 
where is_display=1)
where rn=1
and rownum<=24
order by update_time DESC, create_time DESC 

swt506 2014-11-15
  • 打赏
  • 举报
回复
引用 1 楼 zlloct 的回复:
[quote=引用 楼主 swt506 的回复:] mysql语句 SELECT id,company_id,position,is_display,urgent,geo_code,company_name from l_c_j_view where is_display=1 GROUP BY company_id order by update_time DESC, create_time DESC limit 1,24
能描述一下你这个语句的功能吗[/quote] 查询l_c_j_view 这个表中前24条最新不同公司的信息,按company_id分组,如果company_id一样,取id最大的一条
CT_LXL 2014-11-15
  • 打赏
  • 举报
回复
引用 楼主 swt506 的回复:

select * from(
SELECT  id,
        company_id,
        position,
        is_display,
        urgent,
        geo_code,
        company_name,
        row_number()over(partition by company_id order by 'x') rn,
        rownum rn1
from l_c_j_view 
where is_display=1)
where rn1>1 and rn1<=25
order by update_time DESC, create_time DESC 

CT_LXL 2014-11-15
  • 打赏
  • 举报
回复
引用 楼主 swt506 的回复:
mysql语句 SELECT id,company_id,position,is_display,urgent,geo_code,company_name from l_c_j_view where is_display=1 GROUP BY company_id order by update_time DESC, create_time DESC limit 1,24
能描述一下你这个语句的功能吗

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧