首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

语句转化解决思路

2012-05-16 
语句转化求sql:Select * from (Select *,ROW_NUMBER() OVER (ORDER BY ID DESC ) AS number from Employee

语句转化
求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 numberFROM Employeen AS aWhere number between '1' and '2'
[解决办法]
SQL code
SELECT  *FROM    ( SELECT    * ,--oracle的話這裡的*需要改成把表字段逐一列出,也有可能我的plsql的版本有點老。。。                    ROW_NUMBER() OVER ( ORDER BY ID DESC ) AS number          FROM      Employee        ) AS ResultWHERE   number in (1,2) 

热点排行