日期:2014-05-17  浏览次数:20847 次

ORACLE rownum改成SQL SERVER问题
create   or   replace   view   project   as
select   ROWNUM   AS   ID, "P001_PROJID "   AS   CODE,
            "P001_PROJNAME "   AS   NAME, "P001_EVAPROJ "   AS   REMARK    
            from   PROJECTHRIS;

ORACLE中创建的视图改成SQLSERVER要怎么改?
主要是那个ROWNUM的问题。

------解决方案--------------------
查询视图中生成Id标识
select *, [id]=(select count(1) from jobs b where b.job_id <a.job_id)+1 from jobs a