日期:2014-05-17 浏览次数:21186 次
const string sq = "select [id],[cid],[JXSname],[ObjName],[ObjNum],[ttNum],[tjNum],[ObjJGListNum] from [TTobjinfo] where id in (select max(ID) from [TTobjinfo] as tb group by cid)";//去掉重复项目进度临时表
str = "select [id],[cid],[JXSname],[ObjName],[ObjNum],[ttNum],[tjNum],[ObjJGListNum] from [TTobjinfo] where id in (select max(ID) from (" + sq + ") as tb2 group by ObjName)";
st = "select ObjName from (" + sq + ") as ct2 group by ObjName having (count(ObjName)>=2 and ObjName<>'' and ObjName is not null)";
sql = "select top 10 b2.*,'name' as ac from (" + st + ") as a2 left join (" + str + ") as b2 on a2.ObjName = b2.ObjName";
var ctdb = TtDataBase.ReadTable(sql);
ListView1.DataSource = ctdb;
ListView1.DataBind();
ctdiv.Visible = ctdb.Rows.Count > 0;