2012-08-06 67 views
0

recno()函數僅適用於單個表。當有聯接時,它不起作用。由於我的數據很大,我想用行號一次檢索幾行。有沒有其他的方式來做到這一點,而不使用存儲過程,但oledb。visual fox pro recno()函數

回答

1

您可以使用嵌套查詢。

實施例:

SELECT t0.Customerid, t0.Orderid ; 
    FROM (; 
    SELECT t1.Customerid, t1.Orderid, RecNo() AS rownum ; 
     FROM (; 
     SELECT t2.Customerid, t3.Orderid ; 
      FROM Customers AS t2 ; 
      INNER JOIN Orders AS t3 ON (t2.Customerid = t3.Customerid) ; 
      ORDER BY t2.Customerid 
     ) AS t1 ; 
    ) AS t0 ; 
    WHERE t0.rownum BETWEEN (1) AND (10) 
相關問題