日期:2014-05-16  浏览次数:20816 次

MS-SQL Server的查询语句换成oracle 怎么写?? #### 100%结贴
select listId from (
select *,row_number() over (partition by listId order by Td desc) as num from #a
) a  where  result =58 and num=1


上面是MS-SQL Server的查询语句
在oracle 中这段语句怎么写?

------解决方案--------------------
就这么写就行
------解决方案--------------------
select listId
  from (select a.*,
               row_number() over(partition by listId order by Td desc) as num
          from a) b
 where result = 58
   and num = 1
基本上差不多额
------解决方案--------------------
直接用rowID
------解决方案--------------------
oracle 也有row_number() 这个函数。直接用就是了。
不过oracle 没有#a这种表名。oracle的临时表跟sql server 的不一样。