VFP 连号查询

数据表问题 | 2015-02-18 02:18:16 | 阅读 723 次 | 评论(0)
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
文章评论,共0条
游客请输入验证码
浏览234010次
最新评论
  • cstdio:ooooooo
  • sdta:从VFP入手也不错
  • yuanhouwen:尊敬的sdta大神:作为一个编程外行,看到你关于操控EXCEL的编程程序我觉得特别神奇,想向你...