打印本文 打印本文 关闭窗口 关闭窗口
SQL优化
作者:武汉SEO闵涛  文章来源:敏韬网  点击数33108  更新时间:2007/11/14 12:54:02  文章录入:mintao  责任编辑:mintao
 

if @doCount != 0

  begin

    if @strWhere !=''''''''

    set @strSQL = "select count(*) as Total from [" + @tblName + "] where "+@strWhere

    else

    set @strSQL = "select count(*) as Total from [" + @tblName + "]"

end 

--以上代码的意思是如果@doCount传递过来的不是0,就执行总数统计。以下的所有代码都是@doCount0的情况

else

begin

 

if @OrderType != 0

begin

    set @strTmp = "<(select min"

set @strOrder = " order by [" + @fldName +"] desc"

--如果@OrderType不是0,就执行降序,这句很重要!

end

else

begin

 << 上一页  [21] [22] [23] [24] [25] [26] [27] [28]  下一页

打印本文 打印本文 关闭窗口 关闭窗口