UFN_PROSPECTSEARCH_GETTOPN
Return
Return Type |
---|
table |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ROWS | int | IN | |
@OWNERID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.UFN_PROSPECTSEARCH_GETTOPN
(@ROWS int, @OWNERID uniqueidentifier
)
returns table as
return (
select top (@ROWS)
ID,
NAME,
row_number() over(partition by OWNERID order by DATECHANGED desc) ROWNUMBER
from dbo.PROSPECTSEARCH
where OWNERID = @OWNERID and ISEXPORT = 0
order by DATECHANGED desc
)