求sql自定义函数显示无限分类,谁能帮俺改成sql函数
求sql自定义函数显示无限分类,谁能帮俺改成sql函数
asp版如下
Private Function getlist(mi)
Dim Rss
Set Rss = Conn.Execute("select classid,upid,classname from aucclass where upid="&mi&" order by orderid")
if not rss.eof then
Do While Not Rss.EOF
response.write " "&Rss(2) &"<br>"
getlist = getlist & getlist(rss(0))
Rss.MoveNext
if rss.eof then exit do
loop
end if
Rss.close
set Rss = nothing
End Function
Set Rs = Conn.Execute("select classid,upid,classname from aucclass where upid=0 and classid<=11 order by orderid")
Do While Not Rs.EOF
Response.Write Rs(2) &"<br>"
Response.Write getlist(Rs(0))
Rs.MoveNext
loop
Rs.Close