--测试数据
createtabletest(aavarchar(10),bbnumeric(10,2))
inserttestselect001,50.5
unionallselect002,60
unionallselect003,15.4
unionallselect004,25
unionallselect005,48
unionallselect006,37
go
--查询函数
createfunctionfn_search(@Numnumeric(10,2))
returns@rtable(aavarchar(10),bbnumeric(10,2))
as
begin
declare@ttable(aavarchar(8000),aa1varchar(10),bbnumeric(10,2),levelint)
declare@lint