---
title: "oracle over partition by"
author: "CunningFox"
date: "2015-12-31T09:56:13Z"
tags: ["Oracle"]
categories: ["数据库"]
slug: "oracle-over-partition-by"
draft: false
lastmod: "2015-12-31T09:56:13Z"
id: 2267806
url: "https://cunningfox.iteye.com/blog/2267806"
---

select * from (select b.ID, b.Version,row_number() over(partition by OSCAR_CASE_ID order by VERSION desc) rn from TD_ADVERSE_EVENT b where b.status = 2)
where rn=1