Create Cursor Test (单号 C(4), 姓名 C(20))
Insert Into Test Values ("0002", "小王")
Insert Into Test Values ("0003", "小张")
Insert Into Test Values ("0004", "小王")
Insert Into Test Values ("0005", "莉莉")
Insert Into Test Values ("0006", "莉莉")
Insert Into Test Values ("0007", "小张")
Insert Into Test Values ("0008", "老谢")
Insert Into Test Values ("0009", "小赵")
Insert Into Test Values ("0010", "莉莉")
Insert Into Test Values ("0001", "小张")
Delete From Test Where 单号 Not In(Select Max(单号) From Test Group By 姓名)