sql-表值函数tvf

带有参数的视图

  create function fn_fenye
  (@count as int,@page as int) returns table
  as
  return
  select * from (select row_number() over (order by id)as num,* from dbo.Scores) as tableA
  where tableA.num between @count*(@page-1)+1 and @count*@page
 
  select * from fn_fenye(3,2)

  

posted @ 2015-04-17 14:16  馒头的梦想  阅读(354)  评论(0编辑  收藏  举报