日期:2014-05-18  浏览次数:20479 次

语句转化
求sql:
Select * from (Select *,ROW_NUMBER() OVER (ORDER BY ID DESC ) AS number from Employee ) as Result Where number between cast(1 as varchar) and cast(2 as varchar)
转换成access的语句?
转换成orcle的语句?

------解决方案--------------------
oracle
直接用

SQL code
Select * from (Select *,ROW_NUMBER() OVER (ORDER BY ID DESC ) AS number from Employee ) as Result Where number between '1' and '2'

------解决方案--------------------
access 里貌似没有row_number 函数.oracle 里有.
------解决方案--------------------
access這樣試試
SQL code

SELECT 
*,
(SELECT COUNT(*) FROM Employeen WHERE ID<=a.ID) AS number
FROM Employeen AS a
Where number between '1' and '2'

------解决方案--------------------
SQL code
SELECT  *
FROM    ( SELECT    * ,--oracle的話這裡的*需要改成把表字段逐一列出,也有可能我的plsql的版本有點老。。。
                    ROW_NUMBER() OVER ( ORDER BY ID DESC ) AS number
          FROM      Employee
        ) AS Result
WHERE   number in (1,2)