子查询只能返回一条记录 - TOMMYHU - 专注互联网开发及运营技术,提供相关资料及软件下载,奇趣网络时事评论!
Nov 27

子查询只能返回一条记录 不指定

tommyhu , 20:49 , ASP , Comments(0) , Trackbacks(0) , Reads(8667) , Via Original Large | Medium | Small

错误信息如:


错误SQL:

SELECT ClassID,ClassName,ParentID,ParentPath,Depth,RootID,Child,PrevID,NextID,OrderID,(select top 1 ClassID from [LZ8_Class] b where b.ParentID=a.ClassID And ChannelID = 3 ORDER BY RootID,OrderID desc) AS EndCata,ClassType,LinkUrl,OpenTarget FROM [LZ8_Class] a Where ChannelID = 3 ORDER BY RootID asc,OrderID asc

子查询只能返回一条记录


出错原因:

栏目分类排序乱掉


解决办法:

inc/lz8_class.asp,行1651修改为如下:

       sql_d="SELECT ClassID,ClassName,ParentID,ParentPath,Depth,RootID,Child,PrevID,NextID,OrderID,(select top 1 ClassID from [LZ8_Class] b where b.ParentID=a.ClassID And ChannelID = "& Rs("ChannelID") &" ORDER BY RootID,OrderID,classid desc) AS EndCata,ClassType,LinkUrl,OpenTarget FROM [LZ8_Class] a Where ChannelID = "& Rs("ChannelID") &" ORDER BY RootID asc,OrderID asc"    


▲返回顶部
Last modified by tommyhu on2009/11/27 20:49

Add a comment

Nickname

emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot