VFP 连号查询

作者在 2015-02-18 02:18:16 发布以下内容
Clear
Clear All
CREATE CURSOR test (数字 N(5,0))
INSERT INTO test values(7)
INSERT INTO test values(88)
INSERT INTO test values(9)
INSERT INTO test values(8)
INSERT INTO test values(103)
INSERT INTO test values(12)
INSERT INTO test values(11)
INSERT INTO test values(102)
INSERT INTO test values(101)
Sort To test_order_A On 数字

Create Cursor test1 (数字 N(5,0),组 I)
APPEND FROM test_order_A
Replace All 组 With recno()-数字
Index On 组 Tag zhu Descending Unique
Copy To Fz
Set Order To
Select 0
Use Fz
Scan
    Select test1
    Calculate Min(数字),Max(数字) To nMin,nMax For 组=Fz.组
    ?Transform(nMin)+"-"+Transform(nMax)
EndScan

Clear all
Erase test_order_A.Dbf
Erase Fz.Dbf
数据表问题 | 阅读 1423 次
文章评论,共0条
游客请输入验证码
浏览402257次