优化一句替换一段句子
优化一句替换一段句子
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
分类: c#





