34,593
社区成员
发帖
与我相关
我的任务
分享
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();
}
RxRecordset rst;
sql.format("select top 100 * from %s as b cross apply (select top 100 * from A where b.Id >= a.id*100 and Id<a.id*100+99) as x",B);
rst.Open(sql);
while(!rst.isend())
{
rst.MoveNext();
}
RxRecordset rst;
sql.format("select top 100 * from %s cross apply (select top 100 where exists(select 1 from A where b.Id >= a.id*100 and Id<a.id*100+99)",B);
rst.Open(sql);
while(!rst.isend())
{
rst.MoveNext();
}
RxRecordset rst;
sql="select top 100 * from B where exists(select 1 from A where b.Id >= a.id*100 and Id<a.id*100+99)";
rst.Open(sql);
while(!rst.isend())
{
rst.MoveNext();
}