且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当区分查询时,Row_number()不起作用.

更新时间:2023-11-30 23:20:28

尝试以下一项:

Try this one :

select * , Row_number() OVER(PARTITION BY rolecode ORDER BY ID) AS [Sl.No] from
( 
   select distinct ID,RoleCode,projcode from tab1 where rolecode='ALE' and projcode='268'
) as s