首页 > c# > 优化一句替换一段句子

优化一句替换一段句子

优化一句替换一段句子

public static string Getcc(int classid)
{
try
{
int count = GetCount(classid);---
if (count == 0) return "";

int current = new Random().Next(1, count);
string s="select top 1 aa from table where classid=" +classid +

" and classid not in (select top " + (current - 1) + " id from table where

classid=" + classid+ " order by id ) and del=0 order by id ");
}
catch (Exception ex)
{
..
}
}

语句替换优化

select top 1 aa from table where classid="+classid+" order by NEWID()

原创文章转载请注明出处:云飞扬IT的blog

本文链接: http://www.ajaxcn.net/archives/1697

分类: c# 标签:
一键分享到:新浪微博分享  分享到网易微博    转贴到开心网  推荐到豆瓣  分享到QQ空间    RSS订阅
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.