这个是单个表的分页代码
StringBuilder sqlStr = new StringBuilder();
strSql.Append("select top 10 * from authors where au_id not in (select top " + page * 10 + " au_id from authors)");但是多个表我不知道怎样写,请指教一下:
StringBuilder sqlStr = new StringBuilder();
sqlStr.Append("select top 10 ct.CommodTypeName '商品类型',c.comName '商品名字',c.ComPrice '商品价格',cs.ComNum '商品出销数量',cs.ComTotalPrice '商品出销总价格',ci.MachineName '机器号' ");
sqlStr.Append("from CommoditiesType as ct,Commodities as c,CommoditiesSell as cs,ClientList as ci where 1=1 ");
sqlStr.Append("and ct.CommodTypeID=c.ComKindID and c.CommodID=cs.ComID ");
sqlStr.Append("and cs.ComID not in (select top "+page*10+" ComID from CommoditiesSell)");