当前位置: 代码迷 >> Sql Server >> ADO循环语句如何转成sql语句
  详细解决方案

ADO循环语句如何转成sql语句

热度:42   发布时间:2016-04-27 13:50:44.0
ADO循环语句怎么转成sql语句
C/C++ code
        RxRecordset rst;        sql="select * from A";    rst.Open(sql);    while(!rst.end())    {        int Id=atoi(rst.GetFieldValue("Id"));        RxRecordset rs;        sql.Format("select top 100 * from %s where Id >= %d and Id<%d",B,Id*100,Id*100+99);        rs.Open(sql);        while(!rs.isend())        {           rs.MoveNext();        }        rst.MoveNext();    }


------解决方案--------------------
探讨

引用:

C/C++ code

RxRecordset rst;
sql="select b.* from B as cross apply(select top 100 * from A where b.Id >= a.id*100 and Id<a.id*100+99) as x";
rst.Open(sql);
while(!rst.isend())
……

------解决方案--------------------
探讨

引用:

引用:

C/C++ code

RxRecordset rst;
sql="select b.* from B as cross apply(select top 100 * from A where b.Id >= a.id*100 and Id<a.id*100+99) as x";
……
  相关解决方案